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

[android][image-picker] Support for cameraType #22143

Merged
merged 9 commits into from
Apr 21, 2023
Merged

[android][image-picker] Support for cameraType #22143

merged 9 commits into from
Apr 21, 2023

Conversation

YoussefHenna
Copy link
Contributor

@YoussefHenna YoussefHenna commented Apr 16, 2023

Why

  • Support for cameraType option was missing for android, and only implemented in iOS.
  • Documentation and types for cameraType were missing

How

  • Implemented into Android by adding Intent extras that tell the camera app which camera to use by default
    • This of course is dependent on support from the camera app. I send out all known (that I could find) extras that a camera app might support and hope for the best.
  • Added types and docs for CameraType similarly to how expo-camera currently implements it for consistency. (Maybe should be a shared type?)

Test Plan

  • Ran the bare-expo app on Android
  • Imported expo-image-picker and launched the camera with different values for cameraType
  • Logged the intent extras to ensure intent extras properly sent.
  • It should be noted that this had no effect on my device (Samsung S22 Ultra), most likely my camera app does not support this.

Checklist

YoussefHenna and others added 2 commits April 16, 2023 15:01
- Added support for cameraType on android
- Updated types to include cameraType
- Documented the undocumented cameraType
@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 16, 2023
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 16, 2023
Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution 🏅

YoussefHenna and others added 3 commits April 17, 2023 11:18
Co-authored-by: Łukasz Kosmaty <kosmatylukasz@gmail.com>
Co-authored-by: Łukasz Kosmaty <kosmatylukasz@gmail.com>
@lukmccall
Copy link
Contributor

Please fix Android Unit Tests job by running ./gradlew :expo-image-picker:spotlessApply in bare-expo/android directory

@YoussefHenna
Copy link
Contributor Author

@lukmccall Done! Retry the test when you get the chance.

@YoussefHenna
Copy link
Contributor Author

@lukmccall You can retry the test now and all should be good.

@YoussefHenna
Copy link
Contributor Author

All that's missing now is a final review

@lukmccall lukmccall merged commit d9ad24c into expo:main Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants