Correct cell layout spacing in n-panels UI am: 61cfa57ad8 am: 6f7a4b48e1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15453925

Change-Id: I313081bb87649a5e387f04d1d140ae98e1a55296
This commit is contained in:
Steven Ng
2021-08-03 17:49:37 +00:00
committed by Automerger Merge Worker
+6 -4
View File
@@ -325,6 +325,11 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
setPageSpacing(Math.max(maxInsets, maxPadding));
}
updateWorkspaceScreensPadding();
}
private void updateWorkspaceScreensPadding() {
DeviceProfile grid = mLauncher.getDeviceProfile();
int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx;
int paddingBottom = grid.cellLayoutBottomPaddingPx;
@@ -621,10 +626,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
// created CellLayout.
CellLayout newScreen = (CellLayout) LayoutInflater.from(getContext()).inflate(
R.layout.workspace_screen, this, false /* attachToRoot */);
DeviceProfile grid = mLauncher.getDeviceProfile();
int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx;
int paddingBottom = grid.cellLayoutBottomPaddingPx;
newScreen.setPadding(paddingLeftRight, 0, paddingLeftRight, paddingBottom);
mWorkspaceScreens.put(screenId, newScreen);
mScreenOrder.add(insertIndex, screenId);
@@ -633,6 +634,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
mLauncher.getStateManager().getState(), newScreen, insertIndex);
updatePageScrollValues();
updateWorkspaceScreensPadding();
return newScreen;
}