Merge "Fixed a bug where the statusbar wasn't interactive" into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2019-10-15 09:40:22 +00:00
committed by Android (Google) Code Review

View File

@@ -590,6 +590,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
setScrimAlpha(mScrimInFront, mInFrontAlpha); setScrimAlpha(mScrimInFront, mInFrontAlpha);
setScrimAlpha(mScrimBehind, mBehindAlpha); setScrimAlpha(mScrimBehind, mBehindAlpha);
setScrimAlpha(mScrimForBubble, mBubbleAlpha); setScrimAlpha(mScrimForBubble, mBubbleAlpha);
// The animation could have all already finished, let's call onFinished just in case
onFinished();
dispatchScrimsVisible(); dispatchScrimsVisible();
} }
@@ -688,9 +690,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
scrim.setTag(TAG_KEY_ANIM, null);
onFinished(lastCallback); onFinished(lastCallback);
scrim.setTag(TAG_KEY_ANIM, null);
dispatchScrimsVisible(); dispatchScrimsVisible();
if (!mDeferFinishedListener && mOnAnimationFinished != null) { if (!mDeferFinishedListener && mOnAnimationFinished != null) {
@@ -754,9 +756,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
} }
private void onFinished(Callback callback) { private void onFinished(Callback callback) {
if (!hasReachedFinalState(mScrimBehind) if (isAnimating(mScrimBehind)
|| !hasReachedFinalState(mScrimInFront) || isAnimating(mScrimInFront)
|| !hasReachedFinalState(mScrimForBubble)) { || isAnimating(mScrimForBubble)) {
if (callback != null && callback != mCallback) { if (callback != null && callback != mCallback) {
// Since we only notify the callback that we're finished once everything has // 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 // 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) { private boolean isAnimating(View scrim) {
return scrim.getTag(TAG_KEY_ANIM) != null; return scrim.getTag(TAG_KEY_ANIM) != null;
} }
@@ -849,10 +846,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
} else { } else {
// update the alpha directly // update the alpha directly
updateScrimColor(scrim, alpha, getCurrentScrimTint(scrim)); updateScrimColor(scrim, alpha, getCurrentScrimTint(scrim));
onFinished();
} }
} else {
onFinished();
} }
} }