From a7825a70e890ed6be1d49fac62327ed8a6990788 Mon Sep 17 00:00:00 2001 From: fbaron Date: Tue, 5 Mar 2024 10:03:39 -0800 Subject: [PATCH] Page resets when scrolling slowly fix Fix: 324071635 Flag: NONE Test: Verified manually on RTL and non-RTL Change-Id: Id778a0a01505d30bca4f216322f3ef3b951e63a7 (cherry picked from commit cae498032f44d739626993b71e3377430f606363) --- src/com/android/launcher3/PagedView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 1fede56442..1c23644243 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -826,7 +826,9 @@ public abstract class PagedView extends ViewGrou // or right edge for RTL. final int pageScroll = mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart; - if (outPageScrolls[i] != pageScroll) { + // If there's more than one panel, only update scroll on leftmost panel. + if (outPageScrolls[i] != pageScroll + && (panelCount <= 1 || i == getLeftmostVisiblePageForIndex(i))) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; } @@ -842,7 +844,7 @@ public abstract class PagedView extends ViewGrou if (panelCount > 1) { for (int i = 0; i < childCount; i++) { - // In case we have multiple panels, always use left most panel's page scroll for all + // In case we have multiple panels, always use leftmost panel's page scroll for all // panels on the screen. int adjustedScroll = outPageScrolls[getLeftmostVisiblePageForIndex(i)]; if (outPageScrolls[i] != adjustedScroll) {