From da13cfa59aaa4c6bae76e6c3d0a4161342075d18 Mon Sep 17 00:00:00 2001 From: Gus Prevas Date: Tue, 20 Nov 2018 14:58:48 -0500 Subject: [PATCH] Fixes background animation on dismiss. This change modifies the logic in NotificationStackScrollLayout.updateFirstAndLastBackgroundViews() which determines if the first or last visible notification row has changed. The "old" values were being read after the changes were applied, meaning that the change was never detected, so an animation was never started. Test: manually Change-Id: I29869f5b0f78fd81a17d2c3dbe18c067f94fdb5e Fixes: 119792278 --- .../stack/NotificationStackScrollLayout.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index ff31b261eb858..970e12d6a3c79 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -2770,6 +2770,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private void updateFirstAndLastBackgroundViews() { NotificationSection firstSection = getFirstVisibleSection(); NotificationSection lastSection = getLastVisibleSection(); + ActivatableNotificationView previousFirstChild = + firstSection == null ? null : firstSection.getFirstVisibleChild(); + ActivatableNotificationView previousLastChild = + lastSection == null ? null : lastSection.getLastVisibleChild(); ActivatableNotificationView firstChild = getFirstChildWithBackground(); ActivatableNotificationView lastChild = getLastChildWithBackground(); @@ -2777,10 +2781,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mSections[0], mSections[1], firstChild, lastChild); if (mAnimationsEnabled && mIsExpanded) { - mAnimateNextBackgroundTop = - firstSection == null || firstChild != firstSection.getFirstVisibleChild(); - mAnimateNextBackgroundBottom = - lastSection == null || lastChild != lastSection.getLastVisibleChild(); + mAnimateNextBackgroundTop = firstChild != previousFirstChild; + mAnimateNextBackgroundBottom = lastChild != previousLastChild; mAnimateNextSectionBoundsChange = sectionViewsChanged; } else { mAnimateNextBackgroundTop = false;