Center AllApps on the screen

AllApps used workspace paddings which are unbalanced in verticalBar. This changes it to always be centered. In dynamic grid AllApps now uses the whole width for the layout. In responsive grid it keeps the cell width and center the layout.

Note that this is centered on the screen but nothing could be done regarding the camera inset at this time, as it would need a refactor of how AllApps QSB is layout as well.

Bug: 269632571
Test: NexusLauncherTest
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Change-Id: I326d041bcef211d398d1a5c3210958b689414d49
This commit is contained in:
Thales Lima
2023-11-01 12:00:32 +00:00
parent 72bc6f53f7
commit a25cd90b5e
2 changed files with 10 additions and 7 deletions

View File

@@ -1101,7 +1101,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
mlp.rightMargin = insets.right;
setLayoutParams(mlp);
if (grid.isVerticalBarLayout()) {
if (grid.isVerticalBarLayout() && !FeatureFlags.enableResponsiveWorkspace()) {
setPadding(grid.workspacePadding.left, 0, grid.workspacePadding.right, 0);
} else {
int topPadding = grid.allAppsPadding.top;
@@ -1111,7 +1111,6 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
}
setPadding(grid.allAppsLeftRightMargin, topPadding, grid.allAppsLeftRightMargin, 0);
}
InsettableFrameLayout.dispatchInsets(this, insets);
}