Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Fix app:aspectRatio not working at Camera2#177

Open
keima wants to merge 1 commit intogoogle:masterfrom
keima:issue/fix-set-aspectratio-on-xml
Open

Fix app:aspectRatio not working at Camera2#177
keima wants to merge 1 commit intogoogle:masterfrom
keima:issue/fix-set-aspectratio-on-xml

Conversation

@keima
Copy link

@keima keima commented Jul 5, 2017

When device has Camera2 API (whether Camera2 class expected to successfully initialized or not), app:aspectRatio value is passed following CameraView(Context, AttributeSet, int), CameraView#setAspectRatio(AspectRatio) and Camera2#setAspectRatio(AspectRatio).
In Camera2#setAspectRatio(AspectRatio), checking ratio is exists in mPreviewSizes but it is initializing when Camera2#start().
Therefore mPreviewSizes has no value, so reaching return false and aspect ratio keeps 4:3 (default value).

WayLoCode pushed a commit to WayLoCode/cameraview that referenced this pull request Jul 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

2 participants