Status Update
Comments
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:
sm...@google.com <sm...@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> #7
Fixed in upcoming beta01 release.
Description
I am trying to combine selection library with paging library. Loading items from paging library works ok, but when I try to select item with long click (or with long click and dragging to select more items), the app crash:
java.lang.IllegalStateException: Range start point not set.
at androidx.core.util.Preconditions.checkState(Preconditions.java:131)
at androidx.recyclerview.selection.DefaultSelectionTracker.extendProvisionalRange(DefaultSelectionTracker.java:281)
at androidx.recyclerview.selection.GestureSelectionHelper.extendSelection(GestureSelectionHelper.java:227)
at androidx.recyclerview.selection.GestureSelectionHelper.handleMoveEvent(GestureSelectionHelper.java:204)
at androidx.recyclerview.selection.GestureSelectionHelper.handleTouch(GestureSelectionHelper.java:151)
at androidx.recyclerview.selection.GestureSelectionHelper.onTouchEvent(GestureSelectionHelper.java:125)
at androidx.recyclerview.selection.TouchEventRouter.onTouchEvent(TouchEventRouter.java:103)
at androidx.recyclerview.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2947)
at androidx.recyclerview.widget.RecyclerView.onTouchEvent(RecyclerView.java:3090)
at android.view.View.dispatchTouchEvent(View.java:10013)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2665)
...
When you pre-load some pages with scrolling the RecyclerView, it crash after selecting more items with dragging. See attached videos.
Sample code attached.
Library versions:
RecyclerView: 1.0.0
RecyclerView Selection:1.0.0
Paging: 2.1.0