OSDN Git Service

Do not show bottom controls when undo bar is visible
authorBobby Georgescu <georgescu@google.com>
Wed, 24 Oct 2012 03:52:26 +0000 (20:52 -0700)
committerBobby Georgescu <georgescu@google.com>
Wed, 24 Oct 2012 16:21:43 +0000 (09:21 -0700)
Bug: 7403458
Change-Id: I1e789ebd7f08256a1ccbdb2ac9f2f9f97d0859c6

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

index b24f080..2522188 100644 (file)
@@ -598,7 +598,7 @@ public class PhotoPage extends ActivityState implements
 
     @Override
     public boolean canDisplayBottomControls() {
-        return mIsActive;
+        return mIsActive && !mPhotoView.canUndo();
     }
 
     @Override
@@ -1528,4 +1528,9 @@ public class PhotoPage extends ActivityState implements
             }
         }
     }
+
+    @Override
+    public void onUndoBarVisibilityChanged(boolean visible) {
+        refreshBottomControlsWhenReady();
+    }
 }
index f129961..0758656 100644 (file)
@@ -125,6 +125,7 @@ public class PhotoView extends GLView {
         public void onCommitDeleteImage();
         public void onFilmModeChanged(boolean enabled);
         public void onPictureCenter(boolean isCamera);
+        public void onUndoBarVisibilityChanged(boolean visible);
     }
 
     // The rules about orientation locking:
@@ -1359,6 +1360,7 @@ public class PhotoView extends GLView {
         if(deleteLast) mUndoBarState |= UNDO_BAR_DELETE_LAST;
         mUndoBar.animateVisibility(GLView.VISIBLE);
         mHandler.sendEmptyMessageDelayed(MSG_UNDO_BAR_TIMEOUT, 3000);
+        if (mListener != null) mListener.onUndoBarVisibilityChanged(true);
     }
 
     private void hideUndoBar() {
@@ -1367,6 +1369,7 @@ public class PhotoView extends GLView {
         mUndoBar.animateVisibility(GLView.INVISIBLE);
         mUndoBarState = 0;
         mUndoIndexHint = Integer.MAX_VALUE;
+        mListener.onUndoBarVisibilityChanged(false);
     }
 
     // Check if the one of the conditions for hiding the undo bar has been