question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scroll handle is not positionned properly when scrolling the recycling view

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
BenjiLeecommented, Oct 18, 2021

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)
0reactions
AndroidDeveloperLBcommented, Jan 17, 2021

@bperel OK thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RecyclerView inside ScrollView is not working - Stack Overflow
The proper solution is to use wrap_content on the RecyclerView height and then implement a custom LinearLayoutManager that can properly handle the wrapping....
Read more >
Losing nested scroll position when scrolling parent #754
I tried to debug what was going on but I'm not sure what is going wrong. It looks like the RowGroupView isn't recycled...
Read more >
Using the RecyclerView | CodePath Android Cliffnotes
A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the...
Read more >
Use RecyclerView to display a scrollable list
RecyclerView is designed to be very efficient, even with large lists, by reusing, or recycling, the views that have scrolled off the screen....
Read more >
Restore RecyclerView scroll position | Android Developers
You might have had the problem where a RecyclerView loses the scroll position when your Activity / Fragment is re-created. This usually happens...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found