Fixed
Status Update
Comments
sm...@google.com <sm...@google.com> #2
The fix is done
zh...@google.com <zh...@google.com> #3
Who should I pose the question to? (I don't work on DocumentsUI)
Currently the selection is not sorted and will be reported as the random order defined by HashSet, so making it sorted in any way will be an improvement.
The problem with sorting it according to UI order is that, user may not be able to deliberately use another order they want. On the other hand, if users want UI sort order, they also typically just scroll top to bottom and select in the order that UI presents, so it won't be a big problem.
Moreover, if we ever want to support selection of multiple files across different folders (not necessarily in DocumentsUI, any app using recyclerview-selection might want this), the ui selection order is hard to define.
And even in the case the app wants UI order, it can just manually sort it again; but user selection order is the thing that only the recyclerview-selection library can keep track of, and if not it will be lost and apps will have a very hard time to work around.
Currently the selection is not sorted and will be reported as the random order defined by HashSet, so making it sorted in any way will be an improvement.
The problem with sorting it according to UI order is that, user may not be able to deliberately use another order they want. On the other hand, if users want UI sort order, they also typically just scroll top to bottom and select in the order that UI presents, so it won't be a big problem.
Moreover, if we ever want to support selection of multiple files across different folders (not necessarily in DocumentsUI, any app using recyclerview-selection might want this), the ui selection order is hard to define.
And even in the case the app wants UI order, it can just manually sort it again; but user selection order is the thing that only the recyclerview-selection library can keep track of, and if not it will be lost and apps will have a very hard time to work around.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c3e0e14450725a1b5256974bb41e28d536138732
Author: Steve McKay <smckay@google.com>
Date: Fri Mar 29 14:02:24 2019
Preserve order of selection (by creation time).
- Includes support for provisional selection.
- Selections created by GestureSelection are currently by ordinal position
meaning selection will always be descending (I think).
Intentionally not updating APIs to required Sets that preserve oder,
and not updating docs. I'd prefer to not add selection order guarantees
to the contract.
BUG: 128455535
Test: Added coverage to check selection order.
Change-Id: Ifb016954d4cf74f23a67367919032de82de495cc
M recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/SelectionTest.java
M recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java
M recyclerview/selection/src/main/java/androidx/recyclerview/selection/Selection.java
https://android-review.googlesource.com/937279
https://goto.google.com/android-sha1/c3e0e14450725a1b5256974bb41e28d536138732
Branch: androidx-master-dev
commit c3e0e14450725a1b5256974bb41e28d536138732
Author: Steve McKay <smckay@google.com>
Date: Fri Mar 29 14:02:24 2019
Preserve order of selection (by creation time).
- Includes support for provisional selection.
- Selections created by GestureSelection are currently by ordinal position
meaning selection will always be descending (I think).
Intentionally not updating APIs to required Sets that preserve oder,
and not updating docs. I'd prefer to not add selection order guarantees
to the contract.
BUG: 128455535
Test: Added coverage to check selection order.
Change-Id: Ifb016954d4cf74f23a67367919032de82de495cc
M recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/SelectionTest.java
M recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java
M recyclerview/selection/src/main/java/androidx/recyclerview/selection/Selection.java
sm...@google.com <sm...@google.com> #5
Updated implementation to preserve selection order (order the selection was made).
sm...@google.com <sm...@google.com> #6
Hai. I don't have the ability to modify the Status of this issue. Can you check with the buganizer admin to figure out why?
zh...@google.com <zh...@google.com> #7
Not sure how to contact buganizer admin so I sent a feedback in buganizer. But I guess you are trying to set the status to fixed?
zh...@google.com <zh...@google.com> #8
Received email and the reported buganizer bug about this bug is at b/130621113
sm...@google.com <sm...@google.com> #9
Yup. Fixed. Thanks.
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.