summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/app/CameraAppUI.java5
-rw-r--r--src/com/android/camera/ui/ModeListView.java33
2 files changed, 37 insertions, 1 deletions
diff --git a/src/com/android/camera/app/CameraAppUI.java b/src/com/android/camera/app/CameraAppUI.java
index 962a25392..ac77af781 100644
--- a/src/com/android/camera/app/CameraAppUI.java
+++ b/src/com/android/camera/app/CameraAppUI.java
@@ -1025,7 +1025,9 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
@Override
public void run() {
mModeTransitionView.hideModeCover(null);
- showShimmyDelayed();
+ if (!mDisableAllUserInteractions) {
+ showShimmyDelayed();
+ }
}
};
mModeCoverState = COVER_SHOWN;
@@ -1402,6 +1404,7 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
disableModeOptions();
setShutterButtonEnabled(false);
setSwipeEnabled(false);
+ mModeListView.hideAnimated();
} else {
enableModeOptions();
setShutterButtonEnabled(true);
diff --git a/src/com/android/camera/ui/ModeListView.java b/src/com/android/camera/ui/ModeListView.java
index 63901db69..98c0c2e6d 100644
--- a/src/com/android/camera/ui/ModeListView.java
+++ b/src/com/android/camera/ui/ModeListView.java
@@ -276,6 +276,15 @@ public class ModeListView extends FrameLayout
// Do nothing.
}
+ /**
+ * Hide the mode drawer (with animation, if supported)
+ * and switch to fully hidden state.
+ * Default is to simply call {@link #hide()}.
+ */
+ public void hideAnimated() {
+ hide();
+ }
+
/***************GestureListener implementation*****************/
@Override
public boolean onDown(MotionEvent e) {
@@ -742,6 +751,16 @@ public class ModeListView extends FrameLayout
mCurrentStateManager.setCurrentState(new FullyHiddenState());
}
+ @Override
+ public void hideAnimated() {
+ cancelAnimation();
+ animateListToWidth(0).addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mCurrentStateManager.setCurrentState(new FullyHiddenState());
+ }
+ });
+ }
}
/**
@@ -1440,6 +1459,20 @@ public class ModeListView extends FrameLayout
}
/**
+ * Hide the mode list immediately (provided the current state allows it).
+ */
+ public void hide() {
+ mCurrentStateManager.getCurrentState().hide();
+ }
+
+ /**
+ * Hide the mode list with an animation.
+ */
+ public void hideAnimated() {
+ mCurrentStateManager.getCurrentState().hideAnimated();
+ }
+
+ /**
* Resets the visible width of all the mode selectors to 0.
*/
private void resetModeSelectors() {