-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- Device: Samsung Z Fold 4
- OS Version: Android 13, OneUI 5.1
- Project Version: latest git
🐛 Describe
When onLayoutChildren is called at a non-zero scroll offset, e.g., by a call to Adapter.notifyItemRangeChanged(0, size), the scroll offset will be reset to zero.
🐌 Steps to reproduce
- Have a list of elements and scroll a bit to make a view partially visible.
- Call
notifyItemRangeChanged(0, size)on the adapter, and observeonLayoutChildrenbeing called again. - The current scroll position will be reset, to a random (near?) item which is aligned with the RecyclerView again – the scroll offset of the first visible view is zero.
🦋 Expected behavior
The scroll position should be kept. Compare RecyclerView's built-in LinearLayoutManager, which shows this behavior.
🐝 Requested assignment
I would love to fix this myself, but with the complexity of the RecyclerView library and a lack of knowledge and time on my side, I won't be able to fix this myself.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working