Skip to content
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

Migrate image picker to new Photo Picker (Android 13 compatibility) #499

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

z3ntu
Copy link

@z3ntu z3ntu commented Aug 26, 2023

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.

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
@z3ntu z3ntu changed the title Migrate image picker to new Photo Picker Migrate image picker to new Photo Picker (Android 13 compatibility) Aug 26, 2023
@je-sendra
Copy link

Any updates on this? Being unable to select files from storage kinda breaks the whole app for Android 13 users.

@ligi
Copy link
Owner

ligi commented Dec 15, 2023

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.

@z3ntu
Copy link
Author

z3ntu commented Dec 15, 2023

It does increase minsdk? At least in git diff there's no change in manifest or is this through some other reason?

@je-sendra
Copy link

I have been using the app compiled from this branch and it seems to work just fine

@z3ntu
Copy link
Author

z3ntu commented Dec 15, 2023

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.

@BBazard
Copy link

BBazard commented Jun 10, 2024

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/.

Copy link
Owner

@ligi ligi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the huge latency in processing it.
I gave it more testing and looks good to me - would really love to have this as part of the next release.
The only problem currently is that the tests are not passing anymore as the intents are different - if this problem is solved this will be merged.

@z3ntu
Copy link
Author

z3ntu commented Oct 27, 2024

I looked around a bit but I don't see an obvious way to test the new onclick behavior. Also not super familiar with the photo picker, even less since it's been more than a year since I made this PR 😅

Would it be okay to drop these 3 tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating Pass on Android 13 with Permission Problem?
4 participants