summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PhotoView.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-08-19 17:04:02 +0800
committerWu-cheng Li <wuchengli@google.com>2012-08-20 17:45:46 +0800
commitdbb6acc204ba6f095eb0e49e1298e9ceda2c3096 (patch)
tree8f39fa28ef0f66a1ea8e97d784e1b12d21c43e34 /src/com/android/gallery3d/ui/PhotoView.java
parent691d3f75f896200796b5307143504f9eb260c9e3 (diff)
downloadandroid_packages_apps_Gallery2-dbb6acc204ba6f095eb0e49e1298e9ceda2c3096.tar.gz
android_packages_apps_Gallery2-dbb6acc204ba6f095eb0e49e1298e9ceda2c3096.tar.bz2
android_packages_apps_Gallery2-dbb6acc204ba6f095eb0e49e1298e9ceda2c3096.zip
Rotate the camera screen nail correctly in gingerbread.
In gingerbread, camera screen nail is a static image. Handle its rotation like a bitmap screen nail. bug:6927809 Change-Id: I554483e58fc9e32399acb20f426d7ec35631b7ac
Diffstat (limited to 'src/com/android/gallery3d/ui/PhotoView.java')
-rw-r--r--src/com/android/gallery3d/ui/PhotoView.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index c9fefca28..0dee1b04b 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -78,6 +78,10 @@ public class PhotoView extends GLView {
// Returns true if the item is the Panorama.
public boolean isPanorama(int offset);
+ // Returns true if the item is a static image that represents camera
+ // preview.
+ public boolean isStaticCamera(int offset);
+
// Returns true if the item is a Video.
public boolean isVideo(int offset);
@@ -545,6 +549,7 @@ public class PhotoView extends GLView {
private int mRotation;
private boolean mIsCamera;
private boolean mIsPanorama;
+ private boolean mIsStaticCamera;
private boolean mIsVideo;
private boolean mIsDeletable;
private int mLoadingState = Model.LOADING_INIT;
@@ -561,6 +566,7 @@ public class PhotoView extends GLView {
mIsCamera = mModel.isCamera(0);
mIsPanorama = mModel.isPanorama(0);
+ mIsStaticCamera = mModel.isStaticCamera(0);
mIsVideo = mModel.isVideo(0);
mIsDeletable = mModel.isDeletable(0);
mLoadingState = mModel.getLoadingState(0);
@@ -582,7 +588,7 @@ public class PhotoView extends GLView {
private void updateSize() {
if (mIsPanorama) {
mRotation = getPanoramaRotation();
- } else if (mIsCamera) {
+ } else if (mIsCamera && !mIsStaticCamera) {
mRotation = getCameraRotation();
} else {
mRotation = mModel.getImageRotation(0);
@@ -741,6 +747,7 @@ public class PhotoView extends GLView {
private ScreenNail mScreenNail;
private boolean mIsCamera;
private boolean mIsPanorama;
+ private boolean mIsStaticCamera;
private boolean mIsVideo;
private boolean mIsDeletable;
private int mLoadingState = Model.LOADING_INIT;
@@ -754,6 +761,7 @@ public class PhotoView extends GLView {
public void reload() {
mIsCamera = mModel.isCamera(mIndex);
mIsPanorama = mModel.isPanorama(mIndex);
+ mIsStaticCamera = mModel.isStaticCamera(mIndex);
mIsVideo = mModel.isVideo(mIndex);
mIsDeletable = mModel.isDeletable(mIndex);
mLoadingState = mModel.getLoadingState(mIndex);
@@ -844,7 +852,7 @@ public class PhotoView extends GLView {
private void updateSize() {
if (mIsPanorama) {
mRotation = getPanoramaRotation();
- } else if (mIsCamera) {
+ } else if (mIsCamera && !mIsStaticCamera) {
mRotation = getCameraRotation();
} else {
mRotation = mModel.getImageRotation(mIndex);