diff options
| -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; } |