diff options
Diffstat (limited to 'src/com/android/gallery3d/ui/PhotoView.java')
-rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 1610a1274..46d7c9362 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -71,6 +71,9 @@ public class PhotoView extends GLView { // Returns true if the item is the Camera preview. public boolean isCamera(int offset); + // Returns true if the item is the Panorama. + public boolean isPanorama(int offset); + // Returns true if the item is a Video. public boolean isVideo(int offset); } @@ -403,6 +406,10 @@ public class PhotoView extends GLView { return (mCompensation - mDisplayRotation + 360) % 360; } + private int getPanoramaRotation() { + return mCompensation; + } + //////////////////////////////////////////////////////////////////////////// // Pictures //////////////////////////////////////////////////////////////////////////// @@ -418,6 +425,7 @@ public class PhotoView extends GLView { class FullPicture implements Picture { private int mRotation; private boolean mIsCamera; + private boolean mIsPanorama; private boolean mIsVideo; private boolean mWasCameraCenter; @@ -431,6 +439,7 @@ public class PhotoView extends GLView { mTileView.notifyModelInvalidated(); mIsCamera = mModel.isCamera(0); + mIsPanorama = mModel.isPanorama(0); mIsVideo = mModel.isVideo(0); setScreenNail(mModel.getScreenNail(0)); updateSize(false); @@ -439,7 +448,9 @@ public class PhotoView extends GLView { @Override public void updateSize(boolean force) { - if (mIsCamera) { + if (mIsPanorama) { + mRotation = getPanoramaRotation(); + } else if (mIsCamera) { mRotation = getCameraRotation(); } else { mRotation = mModel.getImageRotation(0); @@ -629,6 +640,7 @@ public class PhotoView extends GLView { private ScreenNail mScreenNail; private Size mSize = new Size(); private boolean mIsCamera; + private boolean mIsPanorama; private boolean mIsVideo; public ScreenNailPicture(int index) { @@ -638,6 +650,7 @@ public class PhotoView extends GLView { @Override public void reload() { mIsCamera = mModel.isCamera(mIndex); + mIsPanorama = mModel.isPanorama(mIndex); mIsVideo = mModel.isVideo(mIndex); setScreenNail(mModel.getScreenNail(mIndex)); } @@ -703,7 +716,9 @@ public class PhotoView extends GLView { @Override public void updateSize(boolean force) { - if (mIsCamera) { + if (mIsPanorama) { + mRotation = getPanoramaRotation(); + } else if (mIsCamera) { mRotation = getCameraRotation(); } else { mRotation = mModel.getImageRotation(mIndex); |