summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index eb66c8395..0df2c30ca 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) {
@@ -459,10 +461,6 @@ public class PhotoUI implements PieListener,
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.v(TAG, "surfaceChanged: width =" + width + ", height = " + height);
- // Make sure preview cover is hidden if preview data is available.
- if (mPreviewCover.getVisibility() != View.GONE) {
- mPreviewCover.setVisibility(View.GONE);
- }
}
@Override
@@ -1143,6 +1141,13 @@ public class PhotoUI implements PieListener,
mPreviewCover.setVisibility(View.VISIBLE);
}
+ public void hidePreviewCover() {
+ // Hide the preview cover if need.
+ if (mPreviewCover.getVisibility() != View.GONE) {
+ mPreviewCover.setVisibility(View.GONE);
+ }
+ }
+
public void onPause() {
cancelCountDown();