Kotlin-AgendaCalendarView
Kotlin-AgendaCalendarView copied to clipboard
Question and bug: making "notifyDataSetChanged" stay on same place
I've noticed that whether you scroll to the top or to the bottom, after it finishes loading, you call notifyDataSetChanged , but the scrolling stay almost on same place, almost perfectly.
How did you do this?
I've written about it here: https://stackoverflow.com/q/47458429/878126
Also, found an issue about this. If I let it load, and then I scroll a bit, it doesn't stay on the current place. Attached video to show issue. device-2017-11-26-114106.zip
Seems you call setSelection right after updating the data, in scrollToCurrentDate function.
This works, but:
- it doesn't take into account the amount of scrolling. That's probably the reason for the bug I've mentioned.
- it uses a linear check of the dates. You could have chosen binary search instead.
- Why do you call
post? Seems to work fine without it.