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

Commit 4f67be7b authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Avoid pixel rounding issue during animation

Bug: 38146787
Test: visual
Change-Id: I9f758f4163cdf9ba8e3ea27ef153d2f025fc795b
parent 0b1b1c43
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2220,14 +2220,15 @@ public class NotificationStackScrollLayout extends ViewGroup
        ActivatableNotificationView firstView = mFirstVisibleBackgroundChild;
        int top = 0;
        if (firstView != null) {
            int finalTranslationY = (int) ViewState.getFinalTranslationY(firstView);
            // Round Y up to avoid seeing the background during animation
            int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
            if (mAnimateNextBackgroundTop
                    || mTopAnimator == null && mCurrentBounds.top == finalTranslationY
                    || mTopAnimator != null && mEndAnimationRect.top == finalTranslationY) {
                // we're ending up at the same location as we are now, lets just skip the animation
                top = finalTranslationY;
            } else {
                top = (int) firstView.getTranslationY();
                top = (int) Math.ceil(firstView.getTranslationY());
            }
        }
        ActivatableNotificationView lastView = mShelf.hasItemsInStableShelf()