RecyclerView-FastScroller icon indicating copy to clipboard operation
RecyclerView-FastScroller copied to clipboard

Scroll handle is not positionned properly when scrolling the recycling view

Open bperel opened this issue 4 years ago • 8 comments

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?

bperel avatar Jan 03 '21 13:01 bperel

Hmm, this surely looks like a bug and is not related to the TODO mentioned. Thanks for letting us know!

shahsurajk avatar Jan 03 '21 17:01 shahsurajk

Is this issue the same as I show here, after modifying the sample a bit:

KK5iETTupT.zip

RecyclerView-FastScroller.zip

?

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 avatar Jan 16 '21 00:01 AndroidDeveloperLB

@AndroidDeveloperLB Yes your video is the issue that I have

bperel avatar Jan 16 '21 11:01 bperel

@bperel Thank you. Do you know of any workaround of this?

AndroidDeveloperLB avatar Jan 16 '21 11:01 AndroidDeveloperLB

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 avatar Jan 16 '21 15:01 bperel

@bperel OK thank you.

AndroidDeveloperLB avatar Jan 17 '21 00:01 AndroidDeveloperLB

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)

BenjiLee avatar Oct 18 '21 18:10 BenjiLee

I have the same issue.

T1mmyK0 avatar Nov 27 '23 20:11 T1mmyK0