Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bab101c8 authored by Tony Wickham's avatar Tony Wickham
Browse files

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
parent 5f8bbcd5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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<T extends View & PageIndicator> 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.