summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimi <timi.rautamaki@gmail.com>2021-05-05 14:53:46 +0200
committerSemavi Ulusoy <doc.divxm@gmail.com>2021-05-14 15:06:32 +0300
commitac1e6708f89c82d0f34b8a07e09eba10279045db (patch)
treed1a3d3e96d2dc778e0a8835aa21ebab28289e489 /src
parent8f96a84b1cb04fe6d57a8e4ade9db9f1e641296a (diff)
Snap: api2: reduce unneeded animationss12.0r11.1
* Only hide/show the menu when necessary Change-Id: Id033e6bfb6e48cc907f0f53c5764a1df28361909
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CaptureUI.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 1e8fcecfe..398b0ab0b 100644
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -281,6 +281,7 @@ public class CaptureUI implements PreviewGestures.SingleTapListener,
private boolean mIsSceneModeLabelClose = false;
private boolean mNeedsAnimationSetup = true;
+ private boolean mIsAnimating = false;
private void previewUIReady() {
if((mSurfaceHolder != null && mSurfaceHolder.getSurface().isValid())) {
@@ -1083,7 +1084,11 @@ public class CaptureUI implements PreviewGestures.SingleTapListener,
}
public void showModeSwitcher(boolean animation) {
- if (mModeSelectLayout == null) return;
+ if (mModeSelectLayout == null ||
+ mModeSelectLayout.getVisibility() == View.VISIBLE) {
+ return;
+ }
+
if (isPreviewMenuBeingShown()) {
removeFilterMenu(true);
}
@@ -1108,9 +1113,13 @@ public class CaptureUI implements PreviewGestures.SingleTapListener,
}
public void closeModeSwitcher(boolean animation) {
- if (mModeSelectLayout == null) return;
+ if (mModeSelectLayout == null ||
+ mModeSelectLayout.getVisibility() != View.VISIBLE) {
+ return;
+ }
- if (animation) {
+ if (animation && !mIsAnimating) {
+ mIsAnimating = true;
mModeSelectLayout.animate()
.alpha(0f)
.scaleX(0.3f).scaleY(0.3f)
@@ -1121,6 +1130,7 @@ public class CaptureUI implements PreviewGestures.SingleTapListener,
@Override
public void onAnimationEnd(Animator animation) {
mModeSelectLayout.setVisibility(View.INVISIBLE);
+ mIsAnimating = false;
}
});
} else {