From 1942d5a54af945d94919ee55bc46175e5885b306 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 1 Mar 2019 13:32:32 -0800 Subject: [PATCH] Fix issue with flashing on overscroll - Apply the bounded current scroll to the overscroll instead of assuming the max scroll (on the last tick, the overscroll amount can be zero, causing us to shift to the max scroll until the next draw) Bug: 126767319 Change-Id: Ia60ecb0c3f18e68d0c91620aa79b21df72c213cf --- src/com/android/launcher3/PagedView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 00da6fac8d..7fa1aa0eea 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -1027,7 +1027,8 @@ public abstract class PagedView extends ViewGrou if (overScrollAmount < 0) { super.scrollTo(overScrollAmount, getScrollY()); } else { - super.scrollTo(mMaxScrollX + overScrollAmount, getScrollY()); + int x = Math.max(0, Math.min(getScrollX(), mMaxScrollX)); + super.scrollTo(x + overScrollAmount, getScrollY()); } invalidate(); }