Code Monkey home page Code Monkey logo

aminography / primedatepicker Goto Github PK

View Code? Open in Web Editor NEW
463.0 463.0 50.0 10.08 MB

PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days.

License: Apache License 2.0

Java 6.11% Kotlin 93.88% Shell 0.02%
calendar calendar-component calendar-view calendarview datepicker datepicker-range gregorian-calendar hijri-calendar japanese-calendar material material-design monthview persian-calendar picker-bottom-sheet

primedatepicker's Introduction

I’m an android developer with 10 years of experience in developing android apps/libs. In my spare time, I'd like to work on new open-source libraries or answer some questions on StackOverflow.

Programming is really a big part of my life and such contributions make me feel it's just not for a living and making money, I'm passionate about it indeed.

Amin's github stats Amin's github stats

primedatepicker's People

Contributors

aminography avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

primedatepicker's Issues

disable future days

Hello,

list of disabled fays could be passed to calendar by disabledDaysList property. but is it possible to disable from specific day onward? eg from today to end

add customized text for labels

hi, thank you again for your library, it has been a great help for me. I was wondering how can I change the default value for some textview in bottomSheet, like "today", "from", "to", "select" and "cancel"? for example can I change the whole text to persian?!

Switch do endDay after chosen startDay in PrimeMonthView or PrimeCalendarView

When I use PrimeMonthView or PrimeCalendarView as standalone component I only can get the startDay on touching it.
I set pickType attribute to PickType.RANGE_START and the callback onDayPickedListener returns only the startDay, i.e, selecting other days only changes the startDay.
If I set pickType to PickType.RANGE_ENDnothing happens.

Is it possible to switch to endDay after chosen the startDay?

Exception when flinging the calendar

Steps:

  1. setup
        calendarView.firstDayOfWeek = Calendar.MONDAY
        calendarView.calendarType = CalendarType.CIVIL
        calendarView.flingOrientation = PrimeCalendarView.FlingOrientation.HORIZONTAL
        calendarView.pickedSingleDayCalendar = CivilCalendar().also {
            it.year = calendar.get(Calendar.YEAR)
            it.month = calendar.get(Calendar.MONTH)
            it.dayOfMonth = 2
        }
        calendarView.pickType = PickType.SINGLE
  1. select a day
  2. fling to the next month

I get this exception (the app does not crash though):

W: Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the RecyclerView or the adapter contents should be postponed tothe next frame.
    java.lang.IllegalStateException:  com.aminography.primedatepicker.calendarview.other.TouchControllableRecyclerView{7e16cfa VFED..... ......ID 0,0-992,863}, adapter:com.aminography.primedatepicker.calendarview.adapter.MonthListAdapter@d8bc2ab, layout:androidx.recyclerview.widget.LinearLayoutManager@5142d08, context:dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper@b7fcca1
        at androidx.recyclerview.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:3163)
        at androidx.recyclerview.widget.RecyclerView$RecyclerViewDataObserver.onChanged(RecyclerView.java:5682)
        at androidx.recyclerview.widget.RecyclerView$AdapterDataObservable.notifyChanged(RecyclerView.java:12624)
        at androidx.recyclerview.widget.RecyclerView$Adapter.notifyDataSetChanged(RecyclerView.java:7555)
        at com.aminography.primedatepicker.calendarview.PrimeCalendarView$OnScrollListener.onScrolled(PrimeCalendarView.kt:990)
        at androidx.recyclerview.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:5318)
        at androidx.recyclerview.widget.RecyclerView.scrollByInternal(RecyclerView.java:2070)
        at androidx.recyclerview.widget.RecyclerView.onTouchEvent(RecyclerView.java:3499)
        at com.aminography.primedatepicker.calendarview.other.TouchControllableRecyclerView.onTouchEvent(TouchControllableRecyclerView.kt:59)
        at android.view.View.dispatchTouchEvent(View.java:13415)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3054)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2741)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
        at android.app.Dialog.dispatchTouchEvent(Dialog.java:861)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
        at android.view.View.dispatchPointerEvent(View.java:13674)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5482)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5285)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
2021-01-27 13:38:07.823 com.example W:     at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7505)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7474)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7435)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7630)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
        at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
        at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:178)
        at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7581)
        at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:7654)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
        at android.view.Choreographer.doCallbacks(Choreographer.java:790)
        at android.view.Choreographer.doFrame(Choreographer.java:718)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Null Pointer Exception

java.lang.NullPointerException
at android.graphics.FontFamily.nAddFontFromAsset(Native Method)
at android.graphics.FontFamily.addFontFromAsset(FontFamily.java:89)
at android.graphics.Typeface.createFromAsset(Typeface.java:225)
at com.aminography.primedatepicker.fragment.PrimeDatePickerBottomSheet.onInitViews(PrimeDatePickerBottomSheet.kt:66)
at com.aminography.primedatepicker.fragment.BaseBottomSheetDialogFragment.setupDialog(BaseBottomSheetDialogFragment.kt:27)
at com.aminography.primedatepicker.fragment.PrimeDatePickerBottomSheet.setupDialog(PrimeDatePickerBottomSheet.kt:28)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:383)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1403)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2076)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1866)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1821)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

Hebrew calendar too?

I've noticed the screenshots show civil and Persian calendars.
Is it also possible to use Hebrew calendar (AKA Jewish calendar) ?

multiple select for dates

hi, I've searched a lot for Persian library and your library was the best !! I just wanted to select multiple dates from my code and show it in a calendar with a different color! is this possible?! if so, how can I achieve this?!
again, thank you for your awesome library

Is it possible to disable specific dates?

I was trying to disable some date or like .setSelectableDays method in Material Date Picker.
Is it possible in PrimeDatePicker? Because as far as i know, it only disable minimum or maximum date.

Color Customisation

Tried setting custom style to the bottom dialog, but it doesnot change the colors.
how to change the stripe showing selected date color.?

Duplicate key: text_size_small

Hello

I get problem duplicate key

Duplicate key: (row=dimen, column=text_size_small), values: [UNDEFINED dimen text_size_small = 0x7f0603a3, UNDEFINED dimen text_size_small = 0x7f060390].

i'm using
implementation 'com.aminography:primedatepicker:3.6.1'
implementation 'com.aminography:primecalendar:1.7.0'

i think problem on my another SDK using same the name

can you change the title dimen text_size_small

Thank you

Function named goto unable to use in java file

Change the function named goto in PrimeCalenderview.kt file, as goto label is already reserved by java and is not used as a function name.

Also provide the functionality to add the arrow buttons, for next and previous month on click.

Is there any option to slow down scroll or to give maximum no of months while scrolling. Also, it will be helpful if the scroll is disabled and only buttons will work.

Pre selected dates

Hi,
How can I select some dates (multiple) pre-selected by users in Month View?

Changing the font family for day and/or text color some selected dates?

Hi, I was browsing through your library, and it really looks great, but I was wondering if there's an option to change the textColor for specific date? For example, the number 19 on todays calendar, I;d like it to be greyed out. Is there anything like it? If not, should I look for a forked solution and search in the adapter MonthListAdapter. I would be nice to have a number of dates in the adapter that should have a different typeface, colors etc... Cheers again for a cool lib :)

PrimeDatePicker as View

is it possible to make primeDataPicker that returns view
it make the lib more flixable to every project

Whats up with 30th JUN ?

PrimeCalendar today = new CivilCalendar();
PrimeCalendar tomorrow = new CivilCalendar();
tomorrow.add(Calendar.DATE, 1);

        LightThemeFactory themeFactory = DatePickerTheme.Companion.getTheme();

        PrimeDatePicker datePicker = PrimeDatePicker.Companion.dialogWith(today)
                .pickSingleDay(callback)
                .initiallyPickedSingleDay(startDate)
                .disabledDays(weekends)
                .minPossibleDate(tomorrow)
                .applyTheme(themeFactory)
                .build();

        datePicker.show(requireActivity().getSupportFragmentManager(), "SOME_TAG");
Qemu.2022.06.30.-.00.10.52.02.DVR.mp4

Labels text change and hijri calendar language

Can you make an update where I can change the labels. i.e the "Select" and "Cancel", because for Saudi Arabia, the Arabic translation of "Select" is a different word, not the one that is shown.
Also can you make another update where the Hijri calendar is shown in English as well. Not just Arabic.
Thank you! Looking forward to your response.

Problem with ProGuard

There is problem with this library when it comes to ProGuard.
Library works just fine without ProGaurd enabled but otherwise it will crash.
Here is the error log:

android.view.InflateException: Binary XML file line #178: Error inflating class com.aminography.primedatepicker.calendarview.PrimeCalendarView at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at android.view.View.inflate(View.java:18532) at com.aminography.primedatepicker.fragment.BaseBottomSheetDialogFragment.setupDialog(SourceFile:26) at com.aminography.primedatepicker.fragment.PrimeDatePickerBottomSheet.setupDialog(SourceFile:30) at androidx.fragment.app.c.onGetLayoutInflater(SourceFile:387) at androidx.fragment.app.Fragment.performGetLayoutInflater(SourceFile:1478) at androidx.fragment.app.l.a(SourceFile:1361) at androidx.fragment.app.l.j(SourceFile:1668) at androidx.fragment.app.l.i(SourceFile:1748) at androidx.fragment.app.l.a(SourceFile:1812) at androidx.fragment.app.a.g(SourceFile:446) at androidx.fragment.app.l.a(SourceFile:2598) at androidx.fragment.app.l.b(SourceFile:2386) at androidx.fragment.app.l.c(SourceFile:2341) at androidx.fragment.app.l.c(SourceFile:2244) at androidx.fragment.app.l$c.run(SourceFile:422) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)  at android.view.View.inflate(View.java:18532)  at com.aminography.primedatepicker.fragment.BaseBottomSheetDialogFragment.setupDialog(SourceFile:26)  at com.aminography.primedatepicker.fragment.PrimeDatePickerBottomSheet.setupDialog(SourceFile:30)  at androidx.fragment.app.c.onGetLayoutInflater(SourceFile:387)  at androidx.fragment.app.Fragment.performGetLayoutInflater(SourceFile:1478)  at androidx.fragment.app.l.a(SourceFile:1361)  at androidx.fragment.app.l.j(SourceFile:1668)  at androidx.fragment.app.l.i(SourceFile:1748)  at androidx.fragment.app.l.a(SourceFile:1812)  at androidx.fragment.app.a.g(SourceFile:446)  at androidx.fragment.app.l.a(SourceFile:2598)  at androidx.fragment.app.l.b(SourceFile:2386)  at androidx.fragment.app.l.c(SourceFile:2341)  at androidx.fragment.app.l.c(SourceFile:2244)  at androidx.fragment.app.l$c.run(SourceFile:422)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5254)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)  Caused by: java.lang.NoSuchFieldException: map at java.lang.Class.getDeclaredField(Class.java:890) at d.a.a.i.a.c(SourceFile:39) at d.a.a.a$b.a(SourceFile:384) at d.a.a.a$b.a(SourceFile:389) at com.aminography.primedatepicker.calendarview.PrimeCalendarView.<init>(SourceFile:514) at com.aminography.primedatepicker.calendarview.PrimeCalendarView.<init>(SourceFile:41) at com.aminography.primedatepicker.calendarview.PrimeCalendarView.<init>(SourceFile) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.view.LayoutInflater.createView(LayoutInflater.java:607)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)  at android.view.View.inflate(View.java:18532)  at com.aminography.primedatepicker.fragment.BaseBottomSheetDialogFragment.setupDialog(SourceFile:26)  at com.aminography.primedatepicker.fragment.PrimeDatePickerBottomSheet.setupDialog(SourceFile:30)  at androidx.fragment.app.c.onGetLayoutInflater(SourceFile:387)  at androidx.fragment.app.Fragment.performGetLayoutInflater(SourceFile:1478)  at androidx.fragment.app.l.a(SourceFile:1361)  at androidx.fragment.app.l.j(SourceFile:1668)  at androidx.fragment.app.l.i(SourceFile:1748)  at androidx.fragment.app.l.a(SourceFile:1812)  at androidx.fragment.app.a.g(SourceFile:446)  at androidx.fragment.app.l.a(SourceFile:2598)  at androidx.fragment.app.l.b(SourceFile:2386)  at androidx.fragment.app.l.c(SourceFile:2341)  at androidx.fragment.app.l.c(SourceFile:2244)  at androidx.fragment.app.l$c.run(SourceFile:422)  at android.os.Handler.handleCallback(Handler.java:739)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5254)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

Problem with month setter

Hello Amin,
watch this:
PrimeCalendar primeCalendar = new CivilCalendar(); primeCalendar.setMonth(12);
then if you check this, it's going to set 0 for month not 12!
image_2021-02-27_033818

Is it possible to access to OnDayPickedListener from PrimeDatePickerBottomSheet?

I am using the PrimeDatePickerBottomSheet with the option pickMultipleDays, so I use the listener MultipleDaysPickCallback, that notices me when the user clicks the final "Select" and finish the selection. But the problem is that I need also a listener that notices me when the user selects a day (a single day. If the user selects 10 days I would need to be noticed the 10 times, not just the last one when he clicks "Select").
I have been studying the library and I have found that this is possible with PrimeCalendarView using onDayPickedListener (actually its parameter: multipleDays: List tells you the list of days you have selected and it triggers when the user selects a day, always), but this is not open in PrimeDatePickerBottomSheet, so I wondered if you could add it in a future version.

Thank you so much for the amazing work you do with this library and sorry to disturb!

FirstDayOfWeek always Sunday

Looks like it's not supporting right now changing firstDayOfWeek from Sunday to Monday. Even if Locale of user have firstDayOfWeek Monday

Leaking Memory

Leak Canary reported that the OnDayPickedListener() is causing a memory leak.
is there a way to remove the listener when i no longer need it.

setting Min and Max dates

Hi thanks for the awesome library, you have mentioned .minPossibleDate(minDate: PrimeCalendar), .minPossibleDate(maxDate: PrimeCalendar) for setting minimum and maximum dates for selection. I was wondering if the minimum and maximum dates can be set based on Calendar.DAY_OF_MONTH.

For example, dates to be available for selection only between the range of given date.

I tried the following,


val today = CivilCalendar()

val min = CalendarFactory.newInstance(CalendarType.CIVIL)
        min.add(Calendar.DAY_OF_MONTH, -2)
val max = CalendarFactory.newInstance(CalendarType.CIVIL)
        min.add(Calendar.DAY_OF_MONTH, +2)

val datePicker = PrimeDatePicker
    .dialogWith(today)
    .pickMultipleDays(callback)
    .minPossibleDate(min)
    .maxPossibleDate(max)
    .build()

datePicker.show(activity.supportFragmentManager, "TAG")

But the calendar dates are not showing up in the dialog. Could you please provide some example code as to how i can implement this. Thanks :)

The BottomSheet has sharp edges instead of rounded one.

The BottomSheet in sample app provided works fine and has rounded corners but for some reason using the library in the app i'm developing,

  1. Then BottomSheet is rectangle. When used dark theme/ dark background color it shows small white filled spaces.
    Screenshot_2021-01-24-19-52-42-37_3917da0d403222df0ac037cc35ea96cb

Is there any fix for this?

BTW Thank you so much for this library. I love every bit of it and how easy it is to impliment it!!

Is it possible to set multiple pre-selected dates in PrimeCalendar?

Hello again Amin,
I wanna know if it possible to set multiple pre-selected dates in PrimeCalendar or not. (this is my code which I try to do this)

List<PrimeCalendar> calendarList = new ArrayList<>();
if (taskList.size() > 0){
for (int i = 0; i < taskList.size(); i++){
int year = Integer.parseInt(taskList.get(i).getDate().substring(0, 4));
int month = Integer.parseInt(taskList.get(i).getDate().replaceAll("-", "/").substring(5, 7));
int day = Integer.parseInt(taskList.get(i).getDate().replaceAll("-", "/").substring(8, 10));
PrimeCalendar primeCalendar = new CivilCalendar();
primeCalendar.setDate(day);
month = month - 1;
primeCalendar.setMonth(month);
primeCalendar.setYear(year);
calendarList.add(primeCalendar);
}
}
binding.calendarCalendarFragment.setPickedMultipleDaysList(calendarList);

Setting pickedDayCircleColor does not work

Hello,

in Version 1.0.5, pickedDayCircleColor does not work.
Both setting a color programmatically and in xml does not produce the desired result. The color always stays the default red.

,

The class PrimeCalendar cannot be found, just like the PersianCalendar;

errror

Where to get the TAG in callback?

We pass a TAG when calling show method of datePicker, but there is no TAG property when getting PrimeCalendar instance in the callback. Am I missing something or is this a problem?

Update Selected MultiDate

Is it possible, whatever I have selected previous selection should display next time. I mean, I want to show pre-selected dates while showing dialog box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.