diff options
author | George Mount <mount@google.com> | 2012-09-07 10:36:25 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2012-09-10 12:42:28 -0700 |
commit | a535522fa7661771351e42465c67ed70825ed2e4 (patch) | |
tree | 6698cab315d1d5cc5e0227dca661bb25d7c74e44 /src/com/android/gallery3d/ui/PhotoView.java | |
parent | 3e654aabf9af7a5396faa7fbea11bc7076db1c3e (diff) | |
download | android_packages_apps_Gallery2-a535522fa7661771351e42465c67ed70825ed2e4.tar.gz android_packages_apps_Gallery2-a535522fa7661771351e42465c67ed70825ed2e4.tar.bz2 android_packages_apps_Gallery2-a535522fa7661771351e42465c67ed70825ed2e4.zip |
Show play icon for panorama.
Bug 7124494
Change-Id: I17fdb5d6bcab1f3997a1ab92fcf45e0309b394b3
Diffstat (limited to 'src/com/android/gallery3d/ui/PhotoView.java')
-rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 934638870..932173f7c 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -79,6 +79,9 @@ public class PhotoView extends GLView { // Returns true if the item is the Panorama. public boolean isPanorama(int offset); + // Returns true if the item uses a special panorama viewer + public boolean usePanoramaViewer(int offset); + // Returns true if the item is a static image that represents camera // preview. public boolean isStaticCamera(int offset); @@ -559,6 +562,7 @@ public class PhotoView extends GLView { private int mRotation; private boolean mIsCamera; private boolean mIsPanorama; + private boolean mUsePanoramaViewer; private boolean mIsStaticCamera; private boolean mIsVideo; private boolean mIsDeletable; @@ -573,6 +577,7 @@ public class PhotoView extends GLView { mIsCamera = mModel.isCamera(0); mIsPanorama = mModel.isPanorama(0); + mUsePanoramaViewer = mModel.usePanoramaViewer(0); mIsStaticCamera = mModel.isStaticCamera(0); mIsVideo = mModel.isVideo(0); mIsDeletable = mModel.isDeletable(0); @@ -712,7 +717,7 @@ public class PhotoView extends GLView { // Draw the play video icon and the message. canvas.translate((int) (cx + 0.5f), (int) (cy + 0.5f)); int s = (int) (scale * Math.min(r.width(), r.height()) + 0.5f); - if (mIsVideo) drawVideoPlayIcon(canvas, s); + if (mIsVideo || mUsePanoramaViewer) drawVideoPlayIcon(canvas, s); if (mLoadingState == Model.LOADING_FAIL) { drawLoadingFailMessage(canvas); } @@ -754,6 +759,7 @@ public class PhotoView extends GLView { private ScreenNail mScreenNail; private boolean mIsCamera; private boolean mIsPanorama; + private boolean mUsePanoramaViewer; private boolean mIsStaticCamera; private boolean mIsVideo; private boolean mIsDeletable; @@ -768,6 +774,7 @@ public class PhotoView extends GLView { public void reload() { mIsCamera = mModel.isCamera(mIndex); mIsPanorama = mModel.isPanorama(mIndex); + mUsePanoramaViewer = mModel.usePanoramaViewer(mIndex); mIsStaticCamera = mModel.isStaticCamera(mIndex); mIsVideo = mModel.isVideo(mIndex); mIsDeletable = mModel.isDeletable(mIndex); @@ -833,7 +840,7 @@ public class PhotoView extends GLView { invalidate(); } int s = Math.min(drawW, drawH); - if (mIsVideo) drawVideoPlayIcon(canvas, s); + if (mIsVideo || mUsePanoramaViewer) drawVideoPlayIcon(canvas, s); if (mLoadingState == Model.LOADING_FAIL) { drawLoadingFailMessage(canvas); } |