summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2015-02-06 13:28:34 +0800
committerLikai Ding <likaid@codeaurora.org>2015-02-06 13:53:02 +0800
commit6c43863efdc8ecaf5915c21d8722305db69fc78a (patch)
treec4b8b1f5eeade6003f049422a619e314152cde40 /src/com/android/camera/PhotoUI.java
parent5e266938aac08975bbe198915adda22cc59ffebe (diff)
downloadandroid_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.tar.gz
android_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.tar.bz2
android_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.zip
SnapdragonCamera: fix preview not shown bug
resizeForPreviewAspectRatio() might be called before SurfaceView's layout process, which causes SurfaceView being set to 0 width and height. Add check before adjusting SurfaceView's dimensions. Change-Id: I66bf6dfcef74253429b2c6cd1a80031d8e30f95d
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index bad7073a9..81837f68f 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -390,6 +390,8 @@ public class PhotoUI implements PieListener,
}
} else {
float width = mOriginalPreviewWidth, height = mOriginalPreviewHeight;
+ if (width == 0 || height == 0) return;
+
if (mOrientationResize) {
scaledTextureWidth = height * mAspectRatio;
if (scaledTextureWidth > width) {