Closed nominalista closed 5 years ago
What happens is that Fotoapparat tries to select a size with an aspect ratio which is exactly equal to screenAspectRatio
(you have a typo btw). It is very unlikely that there is a size with exactly matching ratio so nothing is selected and you see a black screen.
aspectRatio()
has an optional 3rd parameter which defines a tolerance of how far the actual aspect ratio might be from what you defined.
Thanks, I assumed that Fotoapparat can choose any aspect ratio.
I wanted to set the aspect ratio for the preview and picture the same as screen aspect ratio.
Unfortunately as the result I get black screen (despite the fact that
screenAspectRatio
is correct value). 4:3 and 16:9 ratios are working correctly.