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

Commit 54680901 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a grey flash when swiping away the last notification

Change-Id: I12edf673f29abad66fa6704004886124eee9978b
Fixes: 32289359
Test: have 1 notification, swipe it a way, observe no flashing in statusbar
parent fee89015
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -1853,13 +1853,26 @@ 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 {
            abortBackgroundAnimators();
        }
        mAnimateNextBackgroundBottom = false;
        mAnimateNextBackgroundTop = false;
    }

    private void abortBackgroundAnimators() {
        if (mBottomAnimator != null) {
            mBottomAnimator.cancel();
        }
@@ -1867,9 +1880,6 @@ public class NotificationStackScrollLayout extends ViewGroup
            mTopAnimator.cancel();
        }
    }
        mAnimateNextBackgroundBottom = false;
        mAnimateNextBackgroundTop = false;
    }

    private boolean areBoundsAnimating() {
        return mBottomAnimator != null || mTopAnimator != null;