summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2010-04-13 16:31:05 +0800
committerOwen Lin <owenlin@google.com>2010-04-13 16:31:05 +0800
commitb7957a87172eee9a34074bc6aec3a993dee96781 (patch)
tree05392ddea3ecdcdee3f416ab1307cd42913f0baf
parent2acd452b2fe877b57d00278958ea4b34bad75159 (diff)
downloadpackages_apps_LegacyCamera-b7957a87172eee9a34074bc6aec3a993dee96781.zip
packages_apps_LegacyCamera-b7957a87172eee9a34074bc6aec3a993dee96781.tar.gz
packages_apps_LegacyCamera-b7957a87172eee9a34074bc6aec3a993dee96781.tar.bz2
Add aboutToChange to GLRootView.
This allow user to notify GLRootView to expect a size change in a near furture. Change-Id: I8ea2a00c90f0d25c06ee9b292fa9defa2f379abd Fix: 2591831
-rw-r--r--src/com/android/camera/VideoCamera.java15
-rw-r--r--src/com/android/camera/ui/GLRootView.java7
2 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 1fdb842..74e36b3 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -16,6 +16,13 @@
package com.android.camera;
+import com.android.camera.gallery.IImage;
+import com.android.camera.gallery.IImageList;
+import com.android.camera.ui.CamcorderHeadUpDisplay;
+import com.android.camera.ui.GLRootView;
+import com.android.camera.ui.GLView;
+import com.android.camera.ui.HeadUpDisplay;
+
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
@@ -62,13 +69,6 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
-import com.android.camera.gallery.IImage;
-import com.android.camera.gallery.IImageList;
-import com.android.camera.ui.CamcorderHeadUpDisplay;
-import com.android.camera.ui.GLRootView;
-import com.android.camera.ui.GLView;
-import com.android.camera.ui.HeadUpDisplay;
-
import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -526,6 +526,7 @@ public class VideoCamera extends NoSearchActivity
}
private void resizeForPreviewAspectRatio() {
+ if (mGLRootView != null) mGLRootView.aboutToChangeSize();
mPreviewFrameLayout.setAspectRatio(
(double) mProfile.videoFrameWidth / mProfile.videoFrameHeight);
}
diff --git a/src/com/android/camera/ui/GLRootView.java b/src/com/android/camera/ui/GLRootView.java
index 7baeb5d..8b1f947 100644
--- a/src/com/android/camera/ui/GLRootView.java
+++ b/src/com/android/camera/ui/GLRootView.java
@@ -555,6 +555,13 @@ public class GLRootView extends GLSurfaceView
return mLooper;
}
+ // We expect the size will change soon. Please reference onSizeChanged for
+ // more details.
+ public void aboutToChangeSize() {
+ mFirstWidth = 0;
+ mFirstHeight = 0;
+ }
+
// After the device goes to sleep and back, the lock screen may cause the
// orientation to become portrait. So we will allocate a surface with a
// different size. This causes problem when we try to allocate the surface