Re-apply all apps insets when unfolding.

Previously, if insets had been applied while folded ("phone"),
they would stick around when unfolding ("tablet").

This applies the intended 0 left/right margins when in "tablet"
mode regardless of the insets.

Fix: 321159393
Test: Open all apps in phone landscape, unfold
Flag: NA
Change-Id: Ida1f20711a2a2b9b54f6b2c18abf5abf4fd2b175
This commit is contained in:
Andy Wickham
2024-01-29 15:53:12 -08:00
parent af7ff56792
commit 36e4d966a7

View File

@@ -1156,13 +1156,15 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
applyAdapterSideAndBottomPaddings(grid);
MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams();
// Ignore left/right insets on tablet because we are already centered in-screen.
if (grid.isPhone) {
MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams();
if (grid.isTablet) {
mlp.leftMargin = mlp.rightMargin = 0;
} else {
mlp.leftMargin = insets.left;
mlp.rightMargin = insets.right;
setLayoutParams(mlp);
}
setLayoutParams(mlp);
if (!grid.isVerticalBarLayout() || FeatureFlags.enableResponsiveWorkspace()) {
int topPadding = grid.allAppsPadding.top;