Fixed
Status Update
Comments
sm...@google.com <sm...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
zh...@google.com <zh...@google.com> #3
I'll provide the full sample project late next week
ap...@google.com <ap...@google.com> #4
I'm sending to you an app project to show the issue. Every one of the four selection tracker's callbacks are logging to logcat. So you can use logcat to track the issue I reported.
Steps to reproduce:
1 - Click at one of the four list items. It will cause the item to be selected;
2 - Click the "Remove first !" float action button. Realizes that none of the selection tracker's callback will be called.
Steps to reproduce:
1 - Click at one of the four list items. It will cause the item to be selected;
2 - Click the "Remove first !" float action button. Realizes that none of the selection tracker's callback will be called.
sm...@google.com <sm...@google.com> #6
Thanks for reporting the issue.
Looks like an oversight where SelectionTracker's AdapterObserver is simply ignoring rangeRemoved events. I'll aim to land a fix for this in the 1.1 stable release (either the initial release, or a fast-follow-on point release).
Looks like an oversight where SelectionTracker's AdapterObserver is simply ignoring rangeRemoved events. I'll aim to land a fix for this in the 1.1 stable release (either the initial release, or a fast-follow-on point release).
zh...@google.com <zh...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 3b4d015eaebacb3ba82f67248cdc5befbffbc3d0
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 DemoAdapter 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
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/DemoAdapter.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/DemoDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/DemoHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/res/layout/selection_demo_layout.xml
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/1396972
Branch: androidx-master-dev
commit 3b4d015eaebacb3ba82f67248cdc5befbffbc3d0
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 DemoAdapter 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
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/DemoAdapter.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/DemoDetailsLookup.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/DemoHeaderHolder.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/selection/fancy/FancySelectionDemoActivity.java
M samples/Support7Demos/src/main/res/layout/selection_demo_layout.xml
M samples/Support7Demos/src/main/res/menu/selection_demo_actions.xml
M samples/Support7Demos/src/main/res/values/strings.xml
zh...@google.com <zh...@google.com> #8
Fix will appear in 1.1.0-rc02.
sm...@google.com <sm...@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
Description
For example, an app that can concatenate images may allow user to pick multiple image files at a time (e.g. a web app
Currently the androidx.recyclerview.selection.Selection class keeps track of user selection with two HashSets, so changing them to use LinkedHashSet (and modifying setProvisionalSelection() a bit) should be doable to keep user selection order in most cases.