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

Refactoring - Camera (Capture and Video) UI Adaptation for Foldable Devices and Camera Initialization #52

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

yongsuk44
Copy link

@yongsuk44 yongsuk44 commented Mar 28, 2024

To-do

  • : UI adjustment based on screen rotation and foldable state
  • : Generating files to fit the capture and video screen size

Example screen

fold_capture.webm

@yongsuk44 yongsuk44 marked this pull request as draft March 28, 2024 13:23
@yongsuk44 yongsuk44 marked this pull request as ready for review April 2, 2024 14:49
@romanofranz
Copy link

Thanks for doing this!
There are 2 issues when running it on the Pixel Fold (physical device):

  • The camera viewfinder is sideways after rotation
  • The tabletop mode UI is not in sync with the fold orientation
    socialite-fold

@yongsuk44
Copy link
Author

@romanofranz
Thanks, I'll check back. 😀

@yongsuk44
Copy link
Author

@romanofranz

I removed the code that locked the screen orientation when the orientation changes in the camera composable.

Screen_recording_20240408_142929.webm

@romanofranz
Copy link

Thanks, this works better!
There are still few issues:

  • Performance issues on rotation (it takes ~1 second to render the preview after rotation). I changed the rotation animation to jumpcut to mitigate it, but we need to check the cause of the hiccup
  • If you rotate the device upside down (display rotation = 2), the preview is sideways. We may want to add a display listener to catch this corner case.

Overall LGTM on the camera side, adding @donovanfm to check the rest of the refactoring.
Good job!

@yongsuk44
Copy link
Author

android:screenOrientation has been added to enable control of the Activity in four different orientations - link

  • "fullSensor" : The device orientation sensor determines the orientation for any of the four orientations. This is similar to "sensor", except this allows for any of the four possible screen orientations regardless of what the device normally supports. For example, some devices don't normally use reverse portrait or reverse landscape, but this enables those orientations. Added in API level 9.
  • "user" : The user's current preferred orientation.
  • "fullUser" : If the user has locked sensor-based rotation, this behaves the same as user, otherwise it behaves the same as fullSensor and allows any of the four possible screen orientations. Added in API level 18.

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.

None yet

2 participants