You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
setAspectRatio() is called in the constructor of CameraView once the custom XML attribute value for app:aspectRatio is retrieved. At this time mPreviewSizes.ratios() will always be empty because camera info has not been collected yet, which happens on Camera2.start(). So, this method will always return without doing anything, and the default aspect ratio -- 4:3 -- will always be used.
I fixed this by collecting camera info before this check
In Camera2.setAspectRatio(AspectRatio ratio), you have this check at the start of the method:
setAspectRatio() is called in the constructor of CameraView once the custom XML attribute value for app:aspectRatio is retrieved. At this time mPreviewSizes.ratios() will always be empty because camera info has not been collected yet, which happens on Camera2.start(). So, this method will always return without doing anything, and the default aspect ratio -- 4:3 -- will always be used.
I fixed this by collecting camera info before this check
The text was updated successfully, but these errors were encountered: