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

Fix app:aspectRatio not working at Camera2 #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants