OSDN Git Service

Correct undo behavior
authorBobby Georgescu <georgescu@google.com>
Mon, 8 Oct 2012 20:37:41 +0000 (13:37 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 8 Oct 2012 21:55:38 +0000 (14:55 -0700)
Bug: 7307293
Change-Id: I72f814acd3625024f1e2aeccec4abfd28ad3319b

src/com/android/gallery3d/app/PhotoPage.java
src/com/android/gallery3d/ui/PhotoView.java

index 7ded725..3a97c53 100644 (file)
@@ -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;
                         }
 
index 3fa13cf..7097dff 100644 (file)
@@ -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;
     }
 
     ////////////////////////////////////////////////////////////////////////////