mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
workspace: get the correct page when setting paddings
When adding a new page to the workspace, mWorkspaceScreens doesn't necessarily keeps the order. We should use the mScreenOrder field to get the correct index of pages. Fixes: 197198491 Test: drag an app from first page and paddings should be correct Change-Id: I4f79c164391348b53b71a87d5d49cfc4d3d35e5a
This commit is contained in:
@@ -333,7 +333,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
int paddingBottom = grid.cellLayoutBottomPaddingPx;
|
||||
|
||||
int panelCount = getPanelCount();
|
||||
for (int i = mWorkspaceScreens.size() - 1; i >= 0; i--) {
|
||||
int numberOfScreens = mScreenOrder.size();
|
||||
for (int i = 0; i < numberOfScreens; i++) {
|
||||
int paddingLeft = paddingLeftRight;
|
||||
int paddingRight = paddingLeftRight;
|
||||
if (panelCount > 1) {
|
||||
@@ -348,7 +349,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
paddingRight = 0;
|
||||
}
|
||||
}
|
||||
mWorkspaceScreens.valueAt(i).setPadding(paddingLeft, 0, paddingRight, paddingBottom);
|
||||
// SparseArrayMap doesn't keep the order
|
||||
mWorkspaceScreens.get(mScreenOrder.get(i))
|
||||
.setPadding(paddingLeft, 0, paddingRight, paddingBottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user