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 8512e24340e45..8d0d544216951 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2509,9 +2509,9 @@ public class NotificationStackScrollLayout extends ViewGroup mNeedsAnimation = false; } if (!mAnimationEvents.isEmpty() || isCurrentlyAnimating()) { + setAnimationRunning(true); mStateAnimator.startAnimationForEvents(mAnimationEvents, mCurrentStackScrollState, mGoToFullShadeDelay); - setAnimationRunning(true); mAnimationEvents.clear(); updateBackground(); updateViewShadows(); @@ -3133,6 +3133,7 @@ public class NotificationStackScrollLayout extends ViewGroup mListener.onChildLocationsChanged(this); } runAnimationFinishedRunnables(); + setAnimationRunning(false); updateBackground(); updateViewShadows(); } @@ -3249,6 +3250,7 @@ public class NotificationStackScrollLayout extends ViewGroup maxLength = Math.max(mDarkAnimationOriginIndex, getNotGoneChildCount() - mDarkAnimationOriginIndex - 1); } + maxLength = Math.max(0, maxLength); long delay = maxLength * StackStateAnimator.ANIMATION_DELAY_PER_ELEMENT_DARK; fadeAnimator.setStartDelay(delay); fadeAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);