android / socialite

Apache License 2.0
385 stars 68 forks source link

Switch to using CameraX's camera-viewfinder-compose module. #58

Closed donovanfm closed 5 months ago

donovanfm commented 6 months ago

This updates to the new CameraX camera-viewfinder-compose module.

Note: this module hasn't landed in a CameraX version yet, so we have to depend on the SNAPSHOT version. A future PR will fix this when the module reaches an alpha release.

The prototype of camera-viewfinder-compose was copied under /app/src/main/java/com/google/android/samples/socialite/ui/camera/viewfinder/, which is also removed in this PR.

calren commented 6 months ago

@SigmanZero @madebymozart Hoping to get this reviewed and merged today. Thanks!

Will be creating a separate branch for demo purposes after this is merged.

SigmanZero commented 6 months ago

Some observations from testing on a Pixel Fold:

donovanfm commented 5 months ago

Thanks for the feedback, @SigmanZero!

1) Good catch. I checked the main branch, and it didn't go black, but it the Preview did freeze on rotation. And I have great news! I realized I don't have to restart the Preview stream in order to set the rotation on the final image/video. So I updated that code and now the Preview is smooth when you change the orientation. Yay! 2) It looks like the Auto Exposure hasn't converged yet. I tested on a Pixel 7 Pro and a Pixel Fold, and I didn't see the effect as strongly as you pointed out. Perhaps it's something to do with the light in your testing environment. I highly doubt this PR introduced that issue though. 3) I could not reproduce this on a Samsung Galaxy S23, a Pixel 7 Pro, or a Pixel Fold. Can you restart the app and retry? Or send me a stack trace? 4) This is only happening on the Pixel Fold. Other devices show the correct Preview for the final output. I opened https://github.com/android/socialite/issues/62 for this since it's happening on the main branch as well. Since it's an existing issue, I don't think it should block this PR.

SigmanZero commented 5 months ago

Thank you! I think this PR LGTM now - I'll open a separate issue for item 3, I was able to repro on my Pixel Fold and got a screen recording + bug report, but I'm able to capture the front-facing picture on a Galaxy S24 Ultra.