GithubHelp home page GithubHelp logo

aminography / primedatepicker Goto Github PK

View Code? Open in Web Editor NEW
470.0 6.0 51.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%
datepicker datepicker-range monthview calendarview hijri-calendar persian-calendar gregorian-calendar japanese-calendar picker-bottom-sheet material-design material calendar calendar-view calendar-component

primedatepicker's Introduction

PrimeDatePicker

Android Arsenal Android Weekly mavenCentral Codacy Badge API

Firstly, PrimeDatePicker is a tool that provides picking a single day, multiple days, and a range of days. Secondly, you can use internal elements like MonthView and CalendarView as stand-alone views in your projects.

Multiple Days | Civil
BottomSheet | Dark
Range of Days | Persian
BottomSheet | Light
Single Day | Hijri
Dialog | Light
Goto Feature | Japanese
Dialog | Dark

Table of Contents


Core Logic

The ❤️ of this library is provided by PrimeCalendar.


Main Characteristics

  • Endless Scrolling
  • Fully Customizable Views & Themes
  • Align With Material Design
  • Fluent UI
  • RTL Support
  • Landscape Support
  • Various Calendar Types
  • Various Date Picking Strategies
  • Dialog & BottomSheet Presentations
  • Fast Goto

🎯 Download SampleApp.apk


Download

PrimeDatePicker is available on MavenCentral to download using build tools systems. Add the following lines to your build.gradle file:

dependencies {
    implementation 'com.aminography:primedatepicker:3.6.0'
    implementation 'com.aminography:primecalendar:1.7.0'
}

Usage

To enjoy PrimeDatePicker, create an instance using a builder pattern in simple 4 steps.

  1. Decide on BottomSheet or Dialog representation along with an initial calendar:
// To show a date picker with Civil dates, also today as the starting date
val today = CivilCalendar()

val datePicker = PrimeDatePicker.bottomSheetWith(today)  // or dialogWith(today)
  1. Decide on picking strategy along with passing a proper callback:
val callback = SingleDayPickCallback { day ->
    // TODO
}

val today = CivilCalendar()

val datePicker = PrimeDatePicker.bottomSheetWith(today)
        .pickSingleDay(callback)  // or pickRangeDays(callback) or pickMultipleDays(callback)
  1. Apply some optional configurations:
...

val datePicker = PrimeDatePicker.bottomSheetWith(today)
        .pickSingleDay(callback)
        .initiallyPickedSingleDay(pickedDay)
        ...
  1. Build the date picker and show it:
val callback = SingleDayPickCallback { day ->
    // TODO
}

val today = CivilCalendar()

val datePicker = PrimeDatePicker.bottomSheetWith(today)
        .pickSingleDay(callback)
        .initiallyPickedSingleDay(pickedDay)
        .build()
        
datePicker.show(supportFragmentManager, "SOME_TAG")

Java Example

Java

SingleDayPickCallback callback = new SingleDayPickCallback() {
    @Override
    public void onSingleDayPicked(PrimeCalendar singleDay) {
        // TODO
    }
};

// To show a date picker with Japanese dates, also today as the starting date
PrimeCalendar today = new JapaneseCalendar();  

PrimeDatePicker datePicker = PrimeDatePicker.Companion.dialogWith(today)
    .pickSingleDay(callback)
    .build();

datePicker.show(getSupportFragmentManager(), "SOME_TAG");

Builder Configurations

There are several builder functions applying relevant configurations on the date picker.


Function Picking Strategy
• minPossibleDate(minDate: PrimeCalendar) ALL
Specifies the minimum feasible date to be shown in date picker, which is selectable.
• maxPossibleDate(maxDate: PrimeCalendar) ALL
Specifies the maximum feasible date to be shown in date picker, which is selectable.
• firstDayOfWeek(firstDayOfWeek: Int) ALL
Specifies the day that should be considered as the start of the week. Possible values are: Calendar.SUNDAY, Calendar.MONDAY, etc.
• disabledDays(disabledDays: List<PrimeCalendar>) ALL
Specifies the list of disabled days, which aren't selectable.
• applyTheme(themeFactory: ThemeFactory) ALL
Specifies the theme.
• initiallyPickedSingleDay(pickedDay: PrimeCalendar) SingleDay
Specifies initially picked day when the date picker has just shown.
• initiallyPickedRangeDays(startDay: PrimeCalendar, endDay: PrimeCalendar) RangeDays
Specifies initially picked range of days when the date picker has just shown.
• autoSelectPickEndDay(autoSelect: Boolean) RangeDays
Specifies automatic selection of picking end day when the start day gets picked.
• initiallyPickedMultipleDays(pickedDays: List<PrimeCalendar>) MultipleDays
Specifies initially picked multiple days when the date picker has just shown.

Input Calendar Configurations

In addition to the builder functions, PrimeDatePicker receives some configurations from the input calendar. For example:

// shows a Persian calendar, but in English language, which leads to LTR direction
val calendar = PersianCalendar(Locale.ENGLISH).also {
    it.year = 1398                       // determines starting year
    it.month = 7                         // determines starting month
    it.firstDayOfWeek = Calendar.MONDAY  // sets first day of week to Monday
}

val datePicker = PrimeDatePicker.bottomSheetWith(calendar)
        ...
        .build()

Customizing Theme

PrimeDatePicker is fully customizable and you can tailor it to what you desire. Almost everything you see is customizable. For example:

  • text sizes & colors
  • background & element colors
  • padding & distances
  • font typeface
  • string formatter
  • calendar animations & transition parameters
  • etc

In this way, a set of customizable theme factory classes are provided to specify theme parameters. By default, there are two concrete subclasses for the them factory:

You can override their parameters, or inherit a class from, or make your own theme factory.

Here is an example of how to override theme parameters to customize it:

val themeFactory = object : LightThemeFactory() {

    override val typefacePath: String?
        get() = "fonts/Righteous-Regular.ttf"
    
    override val dialogBackgroundColor: Int
        get() = getColor(R.color.yellow100)

    override val calendarViewBackgroundColor: Int
        get() = getColor(R.color.yellow100)

    override val pickedDayBackgroundShapeType: BackgroundShapeType
        get() = BackgroundShapeType.ROUND_SQUARE

    override val calendarViewPickedDayBackgroundColor: Int
        get() = getColor(R.color.green800)
    
    override val calendarViewPickedDayInRangeBackgroundColor: Int
        get() = getColor(R.color.green400)

    override val calendarViewPickedDayInRangeLabelTextColor: Int
        get() = getColor(R.color.gray900)

    override val calendarViewTodayLabelTextColor: Int
        get() = getColor(R.color.purple200)

    override val calendarViewWeekLabelFormatter: LabelFormatter
        get() = { primeCalendar ->
            when (primeCalendar[Calendar.DAY_OF_WEEK]) {
                Calendar.SATURDAY,
                Calendar.SUNDAY -> String.format("%s😍", primeCalendar.weekDayNameShort)
                else -> String.format("%s", primeCalendar.weekDayNameShort)
            }
        }

    override val calendarViewWeekLabelTextColors: SparseIntArray
        get() = SparseIntArray(7).apply {
            val red = getColor(R.color.red300)
            val indigo = getColor(R.color.indigo500)
            put(Calendar.SATURDAY, red)
            put(Calendar.SUNDAY, red)
            put(Calendar.MONDAY, indigo)
            put(Calendar.TUESDAY, indigo)
            put(Calendar.WEDNESDAY, indigo)
            put(Calendar.THURSDAY, indigo)
            put(Calendar.FRIDAY, indigo)
        }

    override val calendarViewShowAdjacentMonthDays: Boolean
        get() = true

    override val selectionBarBackgroundColor: Int
        get() = getColor(R.color.brown600)

    override val selectionBarRangeDaysItemBackgroundColor: Int
        get() = getColor(R.color.orange700)
}

Using above theme, we can transform the light theme (left picture) to the right one.


Normal Light Theme Customized Light Theme

Java Theme Customization Example

BaseThemeFactory themeFactory = new LightThemeFactory() {
    
    @NotNull
    @Override
    public PrimeCalendarView.FlingOrientation getCalendarViewFlingOrientation() {
        return PrimeCalendarView.FlingOrientation.HORIZONTAL;
    }
    
    @Override
    public int getSelectionBarBackgroundColor() {
        return super.getColor(R.color.green300);
    }
    
    // Other customizations...
};

Customizing Texts

If you want to change some texts in PrimeDatePicker, such as a button text, the current solution is to define some strings in your project's strings.xml with equal name defined in the library's strings.xml, to override them.


Stand-Alone Views

To see how to use PrimeMonthView & PrimeCalendarView, refer to wiki page .


Change Log

The change log is available here.


License

Copyright 2019 Mohammad Amin Hassani.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

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?

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

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!

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?!

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

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!!

PrimeDatePicker as View

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

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 :)

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

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)

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

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.

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.

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 :)

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)

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.

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.

,

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

errror

Pre selected dates

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

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

Hebrew calendar too?

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

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

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.?

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) 

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.

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);

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?

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.

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.