launcher: correct page spacing for multiple panels in RTL

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

Change-Id: Idf5bdabb50742498701681e4654e72260054ab47
This commit is contained in:
Thales Lima
2021-09-09 17:06:22 +01:00
parent 9bd2802c9b
commit c2a6f6f4ae
2 changed files with 6 additions and 3 deletions

View File

@@ -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