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

Commit c2a6f6f4 authored by Thales Lima's avatar Thales Lima
Browse files

launcher: correct page spacing for multiple panels in RTL

Fixes 199043583
Test: manual testing in unfolded state in portrait and landscape

Change-Id: Idf5bdabb50742498701681e4654e72260054ab47
parent 9bd2802c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -766,7 +766,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