if force 16:9 ratio is not forced, try taking 4:3

This commit is contained in:
tibbi
2016-09-20 20:21:50 +02:00
parent 139013bf2d
commit 1c113e5472
2 changed files with 3 additions and 2 deletions

View File

@ -324,7 +324,7 @@ public class Preview extends ViewGroup
Collections.sort(sizes, new SizesComparator());
Camera.Size maxSize = sizes.get(0);
for (Camera.Size size : sizes) {
final boolean isProperRatio = !mForceAspectRatio || isProperRatio(size);
final boolean isProperRatio = isProperRatio(size);
final boolean isProperResolution = isProperResolution(size, maxResolution);
if (isProperResolution && isProperRatio) {
maxSize = size;
@ -369,6 +369,7 @@ public class Preview extends ViewGroup
float wantedRatio = (float) 3 / 4;
if (mForceAspectRatio || mIsVideoMode)
wantedRatio = (float) 9 / 16;
final float diff = Math.abs(currRatio - wantedRatio);
return diff < RATIO_TOLERANCE;
}