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

Commit 02a5019c authored by Thales Lima's avatar Thales Lima Committed by Android (Google) Code Review
Browse files

Merge "launcher: correct page spacing for multiple panels in RTL" into sc-v2-dev

parents 2d9741b8 c2a6f6f4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -773,7 +773,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
                childStart += primaryDimension + getChildGap();

                // This makes sure that the space is added after the page, not after each panel
                if (i % panelCount == panelCount - 1) {
                int lastPanel = mIsRtl ? 0 : panelCount - 1;
                if (i % panelCount == lastPanel) {
                    childStart += mPageSpacing;
                }
            }
+4 −2
Original line number Diff line number Diff line
@@ -338,15 +338,17 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
        int paddingBottom = grid.cellLayoutBottomPaddingPx;

        int panelCount = getPanelCount();
        int rightPanelModulus = mIsRtl ? 0 : panelCount - 1;
        int leftPanelModulus = mIsRtl ? panelCount - 1 : 0;
        int numberOfScreens = mScreenOrder.size();
        for (int i = 0; i < numberOfScreens; i++) {
            int paddingLeft = paddingLeftRight;
            int paddingRight = paddingLeftRight;
            if (panelCount > 1) {
                if (i % panelCount == 0) { // left side panel
                if (i % panelCount == leftPanelModulus) {
                    paddingLeft = paddingLeftRight;
                    paddingRight = 0;
                } else if (i % panelCount == panelCount - 1) { // right side panel
                } else if (i % panelCount == rightPanelModulus) {
                    paddingLeft = 0;
                    paddingRight = paddingLeftRight;
                } else { // middle panel