RecyclerView-FastScroller
RecyclerView-FastScroller copied to clipboard
Scroll handle is not positionned properly when scrolling the recycling view
Hello and thank you for this project.
I have noticed an issue when the list contains a small number of elements.
It can be reproduced by only keeping the first 20 or so items in the countries.json
file of the sample app.
When scrolling using the scroll handle everything is going fine :
but when dragging down the list itself to the end, the scroll handle doesn't go until the bottom, even though I have reached the last element in the list :
Is it related to the TODO item mentioned in the README ( Make handle size flexible to item count in adapter
) or is it a bug?
Hmm, this surely looks like a bug and is not related to the TODO mentioned. Thanks for letting us know!
Is this issue the same as I show here, after modifying the sample a bit:
?
BasicAdapter - changed number of items to 10. recycler_view_list_item_center.xml - changed item height to 100dp
Maybe this library could help fix this: https://github.com/zhanghai/AndroidFastScroll ?
@AndroidDeveloperLB Yes your video is the issue that I have
@bperel Thank you. Do you know of any workaround of this?
No, I didn't find a workaround: my project can't use the library until this bug is fixed since it prevents the user from scrolling through the content properly
@bperel OK thank you.
Since this project hasn't been updated in a year and I haven't extensively tested this solution, I'm leaving this here as a comment instead of submitting a PR in case anyone else has come across this issue.
There seems to be an issue with the math onScrolled
Ended up replacing https://github.com/quiph/RecyclerView-FastScroller/blob/v1.0.0/recyclerviewfastscroller/src/main/java/com/qtalk/recyclerviewfastscroller/RecyclerViewFastScroller.kt#L906-L909 with
val availableTrackLength = extent.toFloat() - handleLength
val scrollPositionPercent = (offset.toFloat() / (range - extent))
val finalOffset = availableTrackLength * scrollPositionPercent
moveHandle(finalOffset)
I have the same issue.