summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
authorandralex8 <andralex8@gmail.com>2017-05-28 16:56:39 +0200
committerMichael Bestas <mkbestas@lineageos.org>2017-06-26 23:25:31 +0000
commit25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3 (patch)
treeda64a69e76fb1a5e3c1de48f3da57d46ec959b1a /src/com/android/camera/PhotoUI.java
parent0a068b647a0fce069ad7990009954940c05ad79f (diff)
downloadandroid_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.tar.gz
android_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.tar.bz2
android_packages_apps_Snap-25a16bc1cd3c58c4120e5eaf2796f9d7a8f863e3.zip
Add orientation correction for landscape devices
Snap does not correctly handle devices with a landscape screen as rotation is 0 when device is in landscape while Snap assume that 0 is portrait. This lead to a rotated gui and a deformed preview. This commit: - Solve the gui rotation for Photo, Video and Panorama modules - Solve the deformed preview for Photo and Video (Panorama preview was ok with gui fix) - Solve the PhotoMenu rotation (all devices, it was also broken on portrait devices) Change-Id: Ic0b95904da6e13946c7e46e2e571b26da498db02
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index f00b63eb2..04529f17f 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -344,6 +344,9 @@ public class PhotoUI implements PieListener,
FrameLayout.LayoutParams lp;
float scaledTextureWidth, scaledTextureHeight;
int rotation = CameraUtil.getDisplayRotation(mActivity);
+ if(!CameraUtil.isDefaultToPortrait(mActivity)) {
+ rotation = (rotation - 90) % 360;
+ }
mScreenRatio = CameraUtil.determineRatio(ratio);
if (mScreenRatio == CameraUtil.RATIO_16_9
&& CameraUtil.determinCloseRatio(ratio) == CameraUtil.RATIO_4_3) {
@@ -1226,6 +1229,7 @@ public class PhotoUI implements PieListener,
if (mZoomRenderer != null) {
mZoomRenderer.setOrientation(orientation);
}
+ mOrientation = orientation;
}
public void tryToCloseSubList() {