PassAndroid
PassAndroid copied to clipboard
Migrate image picker to new Photo Picker (Android 13 compatibility)
With Android 13 the previous photo picker didn't trigger at all anymore. But we can use the new Photo Picker UI as described in [0] to get a new and better photo picker. Some refactoring is necessary to suport that.
[0] https://android-developers.googleblog.com/2023/04/photo-picker-everywhere.html
Fixes #477
NOTE: I haven't tested this extensively, just a bit on an Android 13 virtual device in Android Studio but everything seems to work there. Before merging (or basing something on this) please test this also on older devices, I don't know how much is available there of this photo picker. Maybe it needs some runtime if.
It's also been a while since I properly did some development for Android so some code could be a bit weird.
Any updates on this? Being unable to select files from storage kinda breaks the whole app for Android 13 users.
Thanks & sorry for the late review. Tested it on a recent (API 34) and an older device (API 31) and it also works. Need to make some more tests and my mind up as it increases the minSDK . so I need to see that I leave the ppl with the set of devices that I leave out in a good state.
It does increase minsdk? At least in git diff there's no change in manifest or is this through some other reason?
I have been using the app compiled from this branch and it seems to work just fine
@z3ntu : https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia
@je-sendra what API level?
Right, minSdk is currently 14, and PickVisualMedia is 19+. But not sure anyone really is still using an Android version lower than 4.4 KitKat, but I get what you mean. If you really want to continue supporting API 14-18, then you could really add some if for runtime that it chooses an older code path I think.
Currently sdk level 19 support is at 99.8% of the devices, and Google Play services dropped support for API levels below 21 in August 2023 according to https://apilevels.com/.