-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-621 android: Added multiple selection for filepicker #651
GH-621 android: Added multiple selection for filepicker #651
Conversation
I would favor a solution where |
You should not need plugins for |
Right. So the Android WebChromeClient interface provides us a way to customize how we should handle this functionality, and we blindly start a built-in file chooser. I wonder if we should consider a way to do this in a more flexible manner? |
When this PR will be merged? |
When it is fully tested and reviewed. Can you confirm this feature works (on all Android versions) and doesn't break anything else? Having this information would make testing much easier. |
Works great on android 8.1.0 |
What do you need for a merge? Do you need another tests for Androdi 5, 6 and 9 (7 and 8.1 already tested)? How can I help? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I agree we'd need confirmation of testing on various Android versions (and ideally various phone brands too - Google, Samsung, LG, etc.)
Tested on Sony Xperia XZ2 Compact (Android 9). I am gonna test Android 5 and 6 next week. Just need some devices. |
Finally found some devices with Android 5 and 6.
Same behaviour as every other device.
|
Platforms affected
Android
What does this PR do?
Allows filepicker to select multiple files.
What testing has been done on this change?
Checked locally
Notes on testing on devices
Tested on following devices:
The multiple file selection works basically, but behaves different on different devices/software.
Device difference:
On the Moto G5 and Samsung Tab it behaves like expected. Simply use long press (on file explorer, media-gallery, etc ) to start multiple selection.
The Nexus starts the filepicker with multiple selection enabled without using long-press.
Software-difference (on Samsung Tab):
Software-difference (on Sony Xperia XZ2 Compact + Z2):
The reason for this different behaviour is due to the different retun value of the filepicker-intent.
Normally when selecting one file, the intent writes the URL to the 'normal' data field, and when multiple files are selected to the clipData array. This works fine with the Samsung tab and Moto G5. But the intent of the Nexus always writes the first selected file to the data field, even though multiple files are selected. That's why I first check the clipData before the normal data.
Used this stackoverflow anser as inspiration: https://stackoverflow.com/questions/39390781/crosswalk-cordova-android-multiple-file-select
Update 25.03
Tested all nadorid versions from 5 - 9. Always the same behavior:
Checklist