Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da13cfa5 authored by Gus Prevas's avatar Gus Prevas
Browse files

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
parent d0f47278
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;