MohamedRejeb / Calf

Calf is a library that allows you to easily create adaptive UIs and access platform specific APIs with Compose Multiplatform (Adaptive UI, File Picker, WebView, Permissions...).
https://mohamedrejeb.github.io/Calf/
Apache License 2.0
865 stars 37 forks source link

Use PHPicker if file type is image on iOS #50

Closed iruizmar closed 8 months ago

iruizmar commented 8 months ago

Closes #35

I just copied the logic you previously had to use the PHPicker, but it's running only if the desired file type is an image.

Let me know if something else is required. Maybe a different screen in the sample to select an image or a pdf and thus check that the document picker is correctly run would be good.

image
MohamedRejeb commented 8 months ago

Looks good! Thanks for your contribution.

MohamedRejeb commented 8 months ago

Yes, I think it would be a good idea if you can add a new screen with a pdf picker to have both pickers in the sample.

iruizmar commented 8 months ago

Hey @MohamedRejeb 👋🏻 Thanks for that. I added the screen to check the behaviour of selecting images or files and added a fancy switch to decide if the launcher should allow single or multiple selections. This led me to find that the file picker is not working properly on Android. Do you want me to open an issue for that?

By the way, I think I'm not able to merge the branch so feel free to do it when required!

MohamedRejeb commented 8 months ago

I'll merge it, I was just waiting for the build result. Yes, please open an issue for that, I will check it out.