Fixed
Status Update
Comments
sh...@google.com <sh...@google.com> #2
This isn't fixed in alpha 6 :(. It's easily reproducible by starting a drag with one finger and then tapping somewhere else (think back button) which calls clearSelection().
sh...@google.com <sh...@google.com> #3
sh...@google.com <sh...@google.com> #4
Fix is in the works. Until then, a workaround is to avoid calling SelectionTracker#clearSelection while a gesture or mouse-band selection operation is in progress. Such a condition is likely not reflective of user intent (given the ongoing stream of selection operation), but reflective of a stray tap.
State can be monitored using OperationMonitor:
https://developer.android.com/reference/androidx/recyclerview/selection/OperationMonitor.OnChangeListener.html
State can be monitored using OperationMonitor:
je...@google.com <je...@google.com> #5
BTW, working on a fix for this (general improvement to state management). My unassigning this issue from me should not be construed as lack of attention to the matter. I just manage issues by hotlist (rather than ownership).
ap...@google.com <ap...@google.com> #6
Rolling all state-related crash reports up into a single tracking bug.
sh...@google.com <sh...@google.com>
ch...@gmail.com <ch...@gmail.com> #7
Fixed in upcoming beta01 release.
Description
When items are same size as the viewport, and RV is currently laid out such that the viewport shows exactly one complete item, and you remove that item from the dataset, it can't find a reference child that is in the viewport. It defaults to using the first child it found in the hierarchy (
getChild(0)
for regular LTR RVs) as the reference child. But then it doesn't seem to use that child's old position as the anchor position, but just places that child at the start of the viewport.That is a problem if you are looking at the last item (item N) and have two extra items laid out before the visible one. You'd expect that if you remove item N, you will look at item N-1 after that. But, it will actually go to item N-2.
I didn't check the behavior if you're not looking at the last item, but that might be affected as well.