From 639095c6bed84ab0bf9ebc7c4f8b8c944df285a1 Mon Sep 17 00:00:00 2001 From: Bobby Georgescu Date: Mon, 8 Oct 2012 13:37:41 -0700 Subject: [PATCH] Correct undo behavior Bug: 7307293 Change-Id: I72f814acd3625024f1e2aeccec4abfd28ad3319b --- src/com/android/gallery3d/app/PhotoPage.java | 2 +- src/com/android/gallery3d/ui/PhotoView.java | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 7ded7250a..3a97c53d7 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -303,7 +303,7 @@ public class PhotoPage extends ActivityState implements mMediaSet.getMediaItemCount() > 1) { mPhotoView.switchToImage(1); } else { - mPhotoView.setFilmMode(false); + mPhotoView.setFilmMode(mPhotoView.canUndo()); stayedOnCamera = true; } diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 3fa13cfad..7097dff28 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -630,7 +630,7 @@ public class PhotoView extends GLView { if ((mHolding & ~HOLD_TOUCH_DOWN) != 0) return; if (mWantPictureCenterCallbacks && mPositionController.isCenter()) { - mListener.onPictureCenter(mIsCamera && !canUndoLastPicture()); + mListener.onPictureCenter(mIsCamera); } } @@ -1375,13 +1375,8 @@ public class PhotoView extends GLView { } } - // Returns true if the user can still undo the deletion of the last - // remaining picture in the album. We need to check this and delay making - // the camera preview full screen, otherwise the user won't have a chance to - // undo it. - private boolean canUndoLastPicture() { - if ((mUndoBarState & UNDO_BAR_SHOW) == 0) return false; - return (mUndoBarState & UNDO_BAR_DELETE_LAST) != 0; + public boolean canUndo() { + return (mUndoBarState & UNDO_BAR_SHOW) != 0; } //////////////////////////////////////////////////////////////////////////// -- 2.11.0