summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2019-10-14 12:00:36 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-10-16 03:08:34 +0000
commit2d9a50d27f8b470efc010ebe1842b92b7bded66e (patch)
tree57e60ff3d840c0a139951e2b79e7da79b6dd87a4
parent9640aae51530ead601443d9f65609c495781b20e (diff)
downloadbase-2d9a50d27f8b470efc010ebe1842b92b7bded66e.tar.gz
Fixed a bug where the statusbar wasn't interactive
Our restriction if it has finished was too strict before, let's loosen it to call whenever the animation has actually finished not when it reached the final value Fixes: 142189043 Test: atest SystemUITests Change-Id: Ic8a252316346782b485b25d0f5d5458b30511f09 (cherry picked from commit 9449cfc4a608e7d801da642958249a16c536411b)
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index fd3c9526149d..2f567177f814 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -590,6 +590,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
setScrimAlpha(mScrimInFront, mInFrontAlpha);
setScrimAlpha(mScrimBehind, mBehindAlpha);
setScrimAlpha(mScrimForBubble, mBubbleAlpha);
+ // The animation could have all already finished, let's call onFinished just in case
+ onFinished();
dispatchScrimsVisible();
}
@@ -688,9 +690,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
@Override
public void onAnimationEnd(Animator animation) {
+ scrim.setTag(TAG_KEY_ANIM, null);
onFinished(lastCallback);
- scrim.setTag(TAG_KEY_ANIM, null);
dispatchScrimsVisible();
if (!mDeferFinishedListener && mOnAnimationFinished != null) {
@@ -754,9 +756,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
}
private void onFinished(Callback callback) {
- if (!hasReachedFinalState(mScrimBehind)
- || !hasReachedFinalState(mScrimInFront)
- || !hasReachedFinalState(mScrimForBubble)) {
+ if (isAnimating(mScrimBehind)
+ || isAnimating(mScrimInFront)
+ || isAnimating(mScrimForBubble)) {
if (callback != null && callback != mCallback) {
// Since we only notify the callback that we're finished once everything has
// finished, we need to make sure that any changing callbacks are also invoked
@@ -789,11 +791,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
}
}
- private boolean hasReachedFinalState(ScrimView scrim) {
- return scrim.getViewAlpha() == getCurrentScrimAlpha(scrim)
- && scrim.getTint() == getCurrentScrimTint(scrim);
- }
-
private boolean isAnimating(View scrim) {
return scrim.getTag(TAG_KEY_ANIM) != null;
}
@@ -849,10 +846,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
} else {
// update the alpha directly
updateScrimColor(scrim, alpha, getCurrentScrimTint(scrim));
- onFinished();
}
- } else {
- onFinished();
}
}