From bab101c81813a40797189e5100a8ceb49b05fd4c Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 20 Sep 2021 15:12:44 -0700 Subject: [PATCH] Take panel count into account for page indicator size Test: on a device with 2 panels, workspace page indicator width reflects number of needed scrolls rather than number of pages. Fixes: 200607741 Change-Id: Ic2d0bdc644a15944c2d69a832068889071dc25e2 --- src/com/android/launcher3/PagedView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index a7198a80cd..d534c5d85d 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -208,7 +208,7 @@ public abstract class PagedView extends ViewGrou public void initParentViews(View parent) { if (mPageIndicatorViewId > -1) { mPageIndicator = parent.findViewById(mPageIndicatorViewId); - mPageIndicator.setMarkersCount(getChildCount()); + mPageIndicator.setMarkersCount(getChildCount() / getPanelCount()); } } @@ -830,7 +830,7 @@ public abstract class PagedView extends ViewGrou private void dispatchPageCountChanged() { if (mPageIndicator != null) { - mPageIndicator.setMarkersCount(getChildCount()); + mPageIndicator.setMarkersCount(getChildCount() / getPanelCount()); } // This ensures that when children are added, they get the correct transforms / alphas // in accordance with any scroll effects.