summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PhotoView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/ui/PhotoView.java')
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/ui/PhotoView.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index e8c706f05..347d4b3af 100644..100755
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -92,6 +92,9 @@ public class PhotoView extends GLView {
// Returns true if the item is a Video.
public boolean isVideo(int offset);
+ // Returns true if the item is a Gif.
+ public boolean isGif(int offset);
+
// Returns true if the item can be deleted.
public boolean isDeletable(int offset);
@@ -593,7 +596,6 @@ public class PhotoView extends GLView {
private boolean mIsCamera;
private boolean mIsPanorama;
private boolean mIsStaticCamera;
- private boolean mIsVideo;
private boolean mIsDeletable;
private int mLoadingState = Model.LOADING_INIT;
private Size mSize = new Size();
@@ -606,7 +608,6 @@ 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);
setScreenNail(mModel.getScreenNail(0));
@@ -731,8 +732,11 @@ 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 (mLoadingState == Model.LOADING_FAIL) {
+ //Full pic locates at index 0 of the array in PhotoDataAdapter
+ if (mModel.isVideo(0) || mModel.isGif(0)) {
+ drawVideoPlayIcon(canvas, s);
+ }
+ if (mLoadingState == Model.LOADING_FAIL ) {
drawLoadingFailMessage(canvas);
}
@@ -774,7 +778,6 @@ public class PhotoView extends GLView {
private boolean mIsCamera;
private boolean mIsPanorama;
private boolean mIsStaticCamera;
- private boolean mIsVideo;
private boolean mIsDeletable;
private int mLoadingState = Model.LOADING_INIT;
private Size mSize = new Size();
@@ -788,7 +791,6 @@ public class PhotoView extends GLView {
mIsCamera = mModel.isCamera(mIndex);
mIsPanorama = mModel.isPanorama(mIndex);
mIsStaticCamera = mModel.isStaticCamera(mIndex);
- mIsVideo = mModel.isVideo(mIndex);
mIsDeletable = mModel.isDeletable(mIndex);
mLoadingState = mModel.getLoadingState(mIndex);
setScreenNail(mModel.getScreenNail(mIndex));
@@ -852,8 +854,10 @@ public class PhotoView extends GLView {
invalidate();
}
int s = Math.min(drawW, drawH);
- if (mIsVideo) drawVideoPlayIcon(canvas, s);
- if (mLoadingState == Model.LOADING_FAIL) {
+ if (mModel.isVideo(mIndex) || mModel.isGif(mIndex)) {
+ drawVideoPlayIcon(canvas, s);
+ }
+ if (mLoadingState == Model.LOADING_FAIL ) {
drawLoadingFailMessage(canvas);
}
canvas.restore();
@@ -1128,6 +1132,7 @@ public class PhotoView extends GLView {
}
private void deleteAfterAnimation(int duration) {
+ if (mHandler.hasMessages(MSG_DELETE_ANIMATION_DONE)) return;
MediaItem item = mModel.getMediaItem(mTouchBoxIndex);
if (item == null) return;
mListener.onCommitDeleteImage();
@@ -1854,4 +1859,5 @@ public class PhotoView extends GLView {
}
return effect;
}
+
}