Fixed
Status Update
Comments
vi...@google.com <vi...@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().
ss...@gmail.com <ss...@gmail.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:
vi...@google.com <vi...@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).
vi...@google.com <vi...@google.com>
sh...@google.com <sh...@google.com>
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> #9
Project: platform/frameworks/support
Branch: snap-temp-L55000000669795486
commit 9335df63d373a327e06e21e7258660f9bcc429fb
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1404003
Branch: snap-temp-L55000000669795486
commit 9335df63d373a327e06e21e7258660f9bcc429fb
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: snap-temp-L13100000669799324
commit 24d59b6e7a77af3ead3911e929174c086bdb1a0c
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1404339
Branch: snap-temp-L13100000669799324
commit 24d59b6e7a77af3ead3911e929174c086bdb1a0c
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: snap-temp-L10500000669872246
commit ea538c8ae5bf29fecbc39bb30dbfc9974d5b3bb7
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1404370
Branch: snap-temp-L10500000669872246
commit ea538c8ae5bf29fecbc39bb30dbfc9974d5b3bb7
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
ap...@google.com <ap...@google.com> #12
Project: platform/frameworks/support
Branch: snap-temp-L85700000669873256
commit 8b02837e39b9aecaa2a558307890de302da2fe8d
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1404377
Branch: snap-temp-L85700000669873256
commit 8b02837e39b9aecaa2a558307890de302da2fe8d
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
ap...@google.com <ap...@google.com> #13
Project: platform/frameworks/support
Branch: snap-temp-L23500000669881336
commit 34de1726004bf0b9b9aad0622f656007e650ec8d
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
https://android-review.googlesource.com/1404357
Branch: snap-temp-L23500000669881336
commit 34de1726004bf0b9b9aad0622f656007e650ec8d
Author: Steve McKay <smckay@google.com>
Date: Mon Aug 10 17:34:07 2020
Fix issue where selection wasn't update when corresponding items removed from adapter.
Add ItemTouchHelper based swipe away support to Fancy demo app to help provide better test bed (for me...debugging :)
Improved organization of code in Fancy demo activity, to help keep concepts clear and separate for readers.
Update FancySelectionDemoAdapter to support removing items (and generally improve organization).
Move selection demos into RecyclerView/Selection/... "folder" of the samples app.
Bug: 138932671
Test: Manual test of demo app + addition of new test coverage in DefaultSelectionTracker.
Change-Id: Ic7924aca017b35aae65195f2c40e49641177471f
(cherry picked from commit caddb9aae42e7ea049b1d3ab15f328353460a6cb)
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/DefaultSelectionTrackerTest.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestAdapter.java
M recyclerview/recyclerview-selection/src/androidTest/java/androidx/recyclerview/selection/testing/TestSelectionObserver.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
M recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/ItemKeyProvider.java
M samples/Support7Demos/src/main/AndroidManifest.xml
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancyHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoAdapter.java
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
an...@google.com <an...@google.com> #14
The following changes were cherrypicked through
Release Track:
Changes: aosp/1404331
Description
Version used: N/A
Theme used: N/A
Devices/Android versions reproduced on: Emulator / Android 9.0 (Google APIs)
public class MyAdapter extends RecyclerView.Adapter<String> {
private List<String> mData;
public MyAdapter () {
mData = new ArrayList<>();
mData.add("Test1");
mData.add("Test2");
}
public void removeFirst() {
mData.remove(0);
notifyItemRemoved(0);
}
}
Suppose that the first item is selected. Removing it calling MyAdapter.removeFirst() will also call notifyItemRemoved() but the selection tracker observe are not issued (none of its callbacks are invoked). In fact, the selection tracker keeps the selection state saying that there is a selection.