Avoid pixel rounding issue during animation

Bug: 38146787
Test: visual
Change-Id: I9f758f4163cdf9ba8e3ea27ef153d2f025fc795b
This commit is contained in:
Lucas Dupin
2017-05-29 11:30:29 -07:00
parent 0b1b1c4346
commit 4f67be7bfa

View File

@@ -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()