summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
authorJack Yoo <jyoo@codeaurora.org>2016-04-28 10:55:44 -0700
committerJack Yoo <jyoo@codeaurora.org>2016-04-28 14:48:38 -0700
commit1f8e3a0b876e0d578fb3547079f13c937df7a6e5 (patch)
tree8dd65026fbe2fef55df7e2c862ff7ca6e666a5ac /src/com/android/camera/PhotoUI.java
parent2d64c767c9848ba31b34c6672d42db0125da67a6 (diff)
downloadandroid_packages_apps_Snap-1f8e3a0b876e0d578fb3547079f13c937df7a6e5.tar.gz
android_packages_apps_Snap-1f8e3a0b876e0d578fb3547079f13c937df7a6e5.tar.bz2
android_packages_apps_Snap-1f8e3a0b876e0d578fb3547079f13c937df7a6e5.zip
SnapdragonCamera: Fix for layout stretching issue.
There's a device that layoutChangeListener is called later than layoutPreview is called. In this case, it fails to adjust the ratio. Adding checking routine for that. Change-Id: I717cd0ae1827f72eb15b7365001979d8fc4a66a8 CRs-Fixed: 1009374
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index c8e01fea0..57c221379 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -156,6 +156,7 @@ public class PhotoUI implements PieListener,
private int mScreenRatio = CameraUtil.RATIO_UNKNOWN;
private int mTopMargin = 0;
private int mBottomMargin = 0;
+ private boolean mIsLayoutInitializedAlready = false;
private int mOrientation;
private float mScreenBrightness = 0.0f;
@@ -260,7 +261,7 @@ public class PhotoUI implements PieListener,
}
if (mOrientationResize != mPrevOrientationResize
- || mAspectRatioResize) {
+ || mAspectRatioResize || !mIsLayoutInitializedAlready) {
layoutPreview(mAspectRatio);
mAspectRatioResize = false;
}
@@ -459,6 +460,7 @@ public class PhotoUI implements PieListener,
if (mFaceView != null) {
mFaceView.setLayoutParams(lp);
}
+ mIsLayoutInitializedAlready = true;
}
public void setSurfaceTextureSizeChangedListener(SurfaceTextureSizeChangedListener listener) {