You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/02/07 10:57:28 UTC
[GitHub] MatusFiala opened a new pull request #651: GH-621 android: Added
multiple selection for filepicker
MatusFiala opened a new pull request #651: GH-621 android: Added multiple selection for filepicker
URL: https://github.com/apache/cordova-android/pull/651
### Platforms affected
Android
### What does this PR do?
Allows filepicker to select multiple files.
### What testing has been done on this change?
Checked locally
Tested on following devices:
- Moto G5 (Android 7.0)
- Nexus 5X (Android 8.1)
- Samsung Galaxy Tab S4 (Android 8.1)
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):
- normal file-picker: Works like expected
- Google pictures-app: Starts with multiple selection enabled
- Samsung Gallery: Multiple selection does not work when using as filepicker
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
### Checklist
- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ ] Added automated test coverage as appropriate for this change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org