Fixed
Status Update
Comments
em...@google.com <em...@google.com>
ry...@google.com <ry...@google.com>
sm...@google.com <sm...@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().
sm...@google.com <sm...@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:
ap...@google.com <ap...@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).
sm...@google.com <sm...@google.com> #6
Rolling all state-related crash reports up into a single tracking bug.
ap...@google.com <ap...@google.com> #7
Fixed in upcoming beta01 release.
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ce1b333030414b89b1980fa2327774af1b5416dc
Author: Steve McKay <smckay@google.com>
Date: Thu Jul 30 09:33:41 2020
Add support for multiple RecyclerListeners.
This feature is necessitated by RecyclerView-Selection dependency on listening
to recycle events.
Bug: 162504379
Test: Added new coverage.
Relnote: Add support for multiple RecyclerListeners as necessitated to fix b/145767095 affecting RecyclerView-Selection.
Change-Id: I70ad8f9bcf25c2c00fbf5f71d5a991287bef1606
M leanback/leanback/api/current.txt
M leanback/leanback/api/public_plus_experimental_current.txt
M leanback/leanback/api/restricted_current.txt
M recyclerview/recyclerview/api/current.txt
M recyclerview/recyclerview/api/public_plus_experimental_current.txt
M recyclerview/recyclerview/api/restricted_current.txt
A recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerListenerTest.java
M recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
https://android-review.googlesource.com/1381078
Branch: androidx-master-dev
commit ce1b333030414b89b1980fa2327774af1b5416dc
Author: Steve McKay <smckay@google.com>
Date: Thu Jul 30 09:33:41 2020
Add support for multiple RecyclerListeners.
This feature is necessitated by RecyclerView-Selection dependency on listening
to recycle events.
Bug: 162504379
Test: Added new coverage.
Relnote: Add support for multiple RecyclerListeners as necessitated to fix
Change-Id: I70ad8f9bcf25c2c00fbf5f71d5a991287bef1606
M leanback/leanback/api/current.txt
M leanback/leanback/api/public_plus_experimental_current.txt
M leanback/leanback/api/restricted_current.txt
M recyclerview/recyclerview/api/current.txt
M recyclerview/recyclerview/api/public_plus_experimental_current.txt
M recyclerview/recyclerview/api/restricted_current.txt
A recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerListenerTest.java
M recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
sm...@google.com <sm...@google.com> #9
Planning on the fix being released in 1.2. Should be available in 1.2.0-alpha01 in the next few weeks. No telling for sure how long it will take to get 1.2.0 to stable.
cr...@gmail.com <cr...@gmail.com> #10
With the 1.2.0-alpha01
it seems there's a new issue now, caused by the changes, that results in the holder at the top of StableIdKeyProvider.onRecycled()
to always be null. This still results in the same issue that the cache isn't updated properly and the that can cause crashes, because the lookup is wrong.
Description
- I have a RecyclerView using Selection with SelectionPredicates.createSelectSingleAnything() and StableIdKeyProvider.
- A selected item will be colored RED, unselected item will be colored GREEN.
- I select item whose adapterPosition is 0.
- I scroll the list so the item whose adapterPosition is 1 will be on top.
--> What I actually want is the item at '0' will be offscreen and will be detached, but not enough for recycle.
- I select item of adapterPosition '1'.
--> Because it is single selection list, I expect that the item of position '0' will *appear to be unselected*.
- I scroll to top and see if item of position '0' appears to be unselected or not.
Expect: item of position 0 will be colored GREEN (it should appear to be unselected), item of position 1 will be colored RED (it should appear to be selected).
Actual: item of position 0 is colored RED (it appears to be selected), item of position 1 is colored RED (it appears to be selected). (See attachment: recyclerview_selection_issue.mp4).
Note that, the item is correctly unselected, but the change is never delivered to the Adapter due to the behavior of StableIdKeyProvider (I have post about this here:
Source code:
Version used (can be found in the repo): RecyclerView 1.1.0, Selection 1.1.0-beta01.
Thanks in advance.