diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-12-28 13:47:57 +0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-11-02 12:22:25 -0700 |
commit | 55ec556c7f2086f4c99bb3420c0c2fb1d78cc013 (patch) | |
tree | 7073dabb556836ba6790b3cdf68822a287d60654 /src/com/android/camera/VideoUI.java | |
parent | b06a85a5cccc62b0b44bf5ab5bc963655aa24ea0 (diff) | |
download | android_packages_apps_Snap-55ec556c7f2086f4c99bb3420c0c2fb1d78cc013.tar.gz android_packages_apps_Snap-55ec556c7f2086f4c99bb3420c0c2fb1d78cc013.tar.bz2 android_packages_apps_Snap-55ec556c7f2086f4c99bb3420c0c2fb1d78cc013.zip |
Camera: fix preview for landscape devices
Landscape devices have broken preview because PORTRAIT mode is
being abused to check for screen rotation. Use proper rotation
check to fix.
Ported from cm-10.2
Change-Id: I75588cbce9843e180e4be7591f6a43bcec788506
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r-- | src/com/android/camera/VideoUI.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index c30fceeb9..de3d1cc8a 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -382,9 +382,7 @@ public class VideoUI implements PieRenderer.PieListener, } else { ratio = (float) height / width; } - if (mOrientationResize && - mActivity.getResources().getConfiguration().orientation - != Configuration.ORIENTATION_PORTRAIT) { + if (mOrientationResize && CameraUtil.isScreenRotated(mActivity)) { ratio = 1 / ratio; } @@ -727,9 +725,7 @@ public class VideoUI implements PieRenderer.PieListener, } public void setAspectRatio(double ratio) { - if (mOrientationResize && - mActivity.getResources().getConfiguration().orientation - != Configuration.ORIENTATION_PORTRAIT) { + if (mOrientationResize && CameraUtil.isScreenRotated(mActivity)) { ratio = 1 / ratio; } |