Fixed a grey flash when swiping away the last notification

Change-Id: I12edf673f29abad66fa6704004886124eee9978b
Fixes: 32289359
Test: have 1 notification, swipe it a way, observe no flashing in statusbar
This commit is contained in:
Selim Cinek
2016-10-19 16:49:44 -07:00
parent fee89015c5
commit 54680901ed

View File

@@ -1853,13 +1853,26 @@ public class NotificationStackScrollLayout extends ViewGroup
} }
updateBackgroundBounds(); updateBackgroundBounds();
if (!mCurrentBounds.equals(mBackgroundBounds)) { if (!mCurrentBounds.equals(mBackgroundBounds)) {
if (mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom || areBoundsAnimating()) { boolean animate = mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom
|| areBoundsAnimating();
if (!isExpanded()) {
abortBackgroundAnimators();
animate = false;
}
if (animate) {
startBackgroundAnimation(); startBackgroundAnimation();
} else { } else {
mCurrentBounds.set(mBackgroundBounds); mCurrentBounds.set(mBackgroundBounds);
applyCurrentBackgroundBounds(); applyCurrentBackgroundBounds();
} }
} else { } else {
abortBackgroundAnimators();
}
mAnimateNextBackgroundBottom = false;
mAnimateNextBackgroundTop = false;
}
private void abortBackgroundAnimators() {
if (mBottomAnimator != null) { if (mBottomAnimator != null) {
mBottomAnimator.cancel(); mBottomAnimator.cancel();
} }
@@ -1867,9 +1880,6 @@ public class NotificationStackScrollLayout extends ViewGroup
mTopAnimator.cancel(); mTopAnimator.cancel();
} }
} }
mAnimateNextBackgroundBottom = false;
mAnimateNextBackgroundTop = false;
}
private boolean areBoundsAnimating() { private boolean areBoundsAnimating() {
return mBottomAnimator != null || mTopAnimator != null; return mBottomAnimator != null || mTopAnimator != null;