Open EgorChe opened 5 years ago
I don't see you calling scrollToPosition
. What about it "doesn't work"?
I don't see you calling scrollToPosition
I mean setSelection from the ListView class.
What about it "doesn't work"?
If you execute the code, then the focus in the calendar will be on minDate, and not on the selected date.
I see similar problem too. scrollToDate doesn't work. Happens only on Api 28.
CalendarPickerView.FluentInitializer initializer;
if (timeZone != null) {
initializer = calendarPickerView.init(earliestSelectableDate, latestSelectableDate, timeZone);
} else {
initializer = calendarPickerView.init(earliestSelectableDate, latestSelectableDate);
}
initializer.inMode(selectionMode);
//assume date is class property which is available always.
if (date != null) {
calendarPickerView.selectDate(date);
}
@EgorChe Seems like setSelection() from list view has some bug and so not scrolling to selected item ( on devices with API 28). How ever smoothScrollToPosition() is working.
So as a work around try calling below and it should work.
calendarPickerView.selectDate(date, true);
But I agree with you @EgorChe this has to be fixed properly.
Hi! If CalendarPickerView add inside AlertDialog, then In 28 api doesn't work scrollToPosition.
DateRangePickerDialog.java
calendar_picker_layout.xml
MainActivity.kt
activity_main.xml