Open dpelluzi opened 3 years ago
If you change the pickType
to PickType.RANGE_END
it should change the picking type as everything in this library works based on that. In order to switch to PickType.RANGE_END
automatically, you just need to have something like this:
override fun onDayPicked(
pickType: PickType,
singleDay: PrimeCalendar?,
startDay: PrimeCalendar?,
endDay: PrimeCalendar?,
multipleDays: List<PrimeCalendar>
) {
when (pickType) {
PickType.RANGE_START -> {
if (endDay == null) {
calendarView.pickType = PickType.RANGE_END
}
}
// ...
}
}
It has been implemented in PrimeDatePickerImpl
to handle auto-switching for the dialog/bottomsheet date pickers.
When I use PrimeMonthView or PrimeCalendarView as standalone component I only can get the startDay on touching it. I set
pickType
attribute toPickType.RANGE_START
and the callbackonDayPickedListener
returns only the startDay, i.e, selecting other days only changes the startDay. If I setpickType
toPickType.RANGE_END
nothing happens.Is it possible to switch to endDay after chosen the startDay?