From 4f67be7bfa257549989cfa53a33d357588c15a33 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 29 May 2017 11:30:29 -0700 Subject: [PATCH] Avoid pixel rounding issue during animation Bug: 38146787 Test: visual Change-Id: I9f758f4163cdf9ba8e3ea27ef153d2f025fc795b --- .../statusbar/stack/NotificationStackScrollLayout.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 431f646163f5c..c8af4c863a5f9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -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()