Closed geometer closed 4 years ago
Thanks for this. I have noticed the issue but haven't looked into it.
Rather than partially rolling back 7cc13a5, I think we could add a simple check for isReverseLayout()
, and only account for the scrollPosState.rowTopOffset
if it returns false. This would ensure compatibility.
I agree this is a safe way.
On the other hand, if you know what the reverse layout is, it should be easy to check if it works or not. I'm sure the same jumps are visible in reverse layout mode too, as the current code only uses the item index. Maybe there should be "+ scrollPosState.rowTopOffset" instead of "- scrollPosState.rowTopOffset" :).
Hmm, I tried to call LayoutManager.setReverseLayout(true) in my app (GridLayoutManager, not measurable). Seems like the problem is deeper than I expected. There are jumps, and there is an additional vertical shift of the thumb.
OK, it sounds like this pull request is not in a state where it can be merged in. If I get a chance, I'll have a look into this issue. Feel free to reopen or file another PR if you do find time to implement a compatible fix.
In the release version, the thumb does not move until the top item changes and jumps every time a new top item crosses the edge.
Actually the change is a partial rollback of https://github.com/timusus/RecyclerView-FastScroll/commit/7cc13a5d8dbf537ba6b57a3042a7b2737214252e. I did not test how this works with reverse layout, so maybe this requires some extra investigation before merging.