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
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commitc4d80506754415446b575f566911890c15016953 (patch)
tree5bcc9e597ac702d2a244bfefed7a03f0e24247cf /src/com/android/camera/PhotoUI.java
parentaba0a162b09dc1bb1246e5f558a01a4b28d24f0d (diff)
downloadandroid_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.tar.gz
android_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.tar.bz2
android_packages_apps_Snap-c4d80506754415446b575f566911890c15016953.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')
-rwxr-xr-xsrc/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 5daab2f91..a467e9481 100755
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -361,6 +361,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) {
@@ -1399,6 +1402,7 @@ public class PhotoUI implements PieListener,
RotateImageView v = (RotateImageView) mReviewImage;
v.setOrientation(orientation, animation);
}
+ mOrientation = orientation;
}
public void tryToCloseSubList() {