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 4c242ccf691c7..19f407492e1fd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2511,9 +2511,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(); @@ -3131,6 +3131,7 @@ public class NotificationStackScrollLayout extends ViewGroup mListener.onChildLocationsChanged(this); } runAnimationFinishedRunnables(); + setAnimationRunning(false); updateBackground(); updateViewShadows(); } @@ -3247,6 +3248,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);