diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2016-10-20 02:21:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-10-20 02:21:37 +0000 |
commit | d9a569ae580ec140033a57eb0fa50b4bfe9c4a27 (patch) | |
tree | ebbc4a7a1ab66d95248cabac2a190b851e6755e6 | |
parent | 049980c2845d036918bf078fdaff78dba2322906 (diff) | |
parent | 54680901ed86c7cb7606b515118928e4012bd60e (diff) | |
download | base-d9a569ae580ec140033a57eb0fa50b4bfe9c4a27.tar.gz |
Merge "Fixed a grey flash when swiping away the last notification" into nyc-mr1-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index f3e5c94be032..a6fe4382475e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1853,24 +1853,34 @@ public class NotificationStackScrollLayout extends ViewGroup } updateBackgroundBounds(); if (!mCurrentBounds.equals(mBackgroundBounds)) { - if (mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom || areBoundsAnimating()) { + boolean animate = mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom + || areBoundsAnimating(); + if (!isExpanded()) { + abortBackgroundAnimators(); + animate = false; + } + if (animate) { startBackgroundAnimation(); } else { mCurrentBounds.set(mBackgroundBounds); applyCurrentBackgroundBounds(); } } else { - if (mBottomAnimator != null) { - mBottomAnimator.cancel(); - } - if (mTopAnimator != null) { - mTopAnimator.cancel(); - } + abortBackgroundAnimators(); } mAnimateNextBackgroundBottom = false; mAnimateNextBackgroundTop = false; } + private void abortBackgroundAnimators() { + if (mBottomAnimator != null) { + mBottomAnimator.cancel(); + } + if (mTopAnimator != null) { + mTopAnimator.cancel(); + } + } + private boolean areBoundsAnimating() { return mBottomAnimator != null || mTopAnimator != null; } |