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
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 00da6fa..7fa1aa0 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -1027,7 +1027,8 @@
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();
}