-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix onDateSelected not called #92
base: master
Are you sure you want to change the base?
Conversation
Fix #95 This will only work if the first selected date is the oldest In order to fix this if the first selected date is the newest:
|
Thank you for reviewing. |
What is the snapDistance ? |
Yes.. What is the snapDistance ? where put this code: |
with this fix, the method calls two times when I made click on item and not when I scroll if ((snapDistance[0] != -1) && (snapDistance[0] != -2) && (snapDistance[0] != 1) && (snapDistance[0] != 2)){ |
This solution only works when the user scroll on the calendar, but if the user click on item the method notifyCalendarListener call two times because the snapDistance[0] is equal to 1 always... |
Hi this is my solution, I check if the calendar is on the first position or in the last position, with the method isItemDisabled.. The others solution work in some cases, but for some reason the behavior of the calendar is different when the user scroll or the user click on some item or if the user scroll fast the values of snapDistance always get different values, for example, if the user click on item the values are -1,0 or 1,0 if the user scroll fast the values are 0,0, if the user scroll slow the values are for example -31,0 and then 0,0.... So to solve the problem is call the method when the values are different of 0,0 and are not in the begin or end of the scroll @OverRide
|
Fix HorizontalCalendarListener#onDateSelected not called when first date selected.
Fix #90