Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
jb...@google.com <jb...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ma...@gmail.com <ma...@gmail.com> #4
I have two comments:
- Is the order of the
ClipData
relevant, i.e. does it reflect the order in which the user selected the content? In that case it might make sense to use aLinkedHashSet
instead of aHashSet
. - Why not return a
Set
instead of aList
? That would get rid of some copying and carry the semantic that content can't be selected twice (which seems like a safe assumption to me).
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 13352b5a3b2aca96bba64662027347d66d39c6b5
Author: Ian Lake <ilake@google.com>
Date: Fri May 08 16:10:17 2020
Keep the ordering of ClipData in the resulting list
When combining the Intent's data field and the
Uris in the ClipData, we should attempt to maintain
any ordering present in the ClipData's items.
Test: existing tests pass
BUG: 152941153
Change-Id: I26ee368605054a3e8c090d384ac0843674ee378f
M activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java
https://android-review.googlesource.com/1306485
Branch: androidx-master-dev
commit 13352b5a3b2aca96bba64662027347d66d39c6b5
Author: Ian Lake <ilake@google.com>
Date: Fri May 08 16:10:17 2020
Keep the ordering of ClipData in the resulting list
When combining the Intent's data field and the
Uris in the ClipData, we should attempt to maintain
any ordering present in the ClipData's items.
Test: existing tests pass
BUG: 152941153
Change-Id: I26ee368605054a3e8c090d384ac0843674ee378f
M activity/activity/src/main/java/androidx/activity/result/contract/ActivityResultContracts.java
il...@google.com <il...@google.com> #6
Re #4 - As part of Activity 1.2.0-alpha05, we keep the ordering of the ClipData in the final result. There's no guarantee that the ordering there has any relation to the other the user has picked items (or even if it is in first->last or last->first order) since that ordering is completely under the control of the other activity, but it at least serves as a consistent starting point.
We're staying with List
for the API side of things; the use of a Set internally is just that - an internal implementation detail.
ih...@gmail.com <ih...@gmail.com> #7
When do you plan to release 1.2.0-alpha05?
Description
Version used: 1.2.0-alpha03
Devices/Android versions reproduced on: All
I used the OpenDocuments contract in my project, everything works fine if more than one file is selected in the called explorer.
But if you select only one (which the system does not prohibit) - the contract returns null in response.
I create my own, it seems to me a logical workaround for this situation, but I would like to see this solution out of the box: