From 36e4d966a7821dd67d31a07f0c6a1cf1eee11d12 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Mon, 29 Jan 2024 15:53:12 -0800 Subject: [PATCH] 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 --- .../launcher3/allapps/ActivityAllAppsContainerView.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 930196d687..ae2849e49d 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -1156,13 +1156,15 @@ public class ActivityAllAppsContainerView 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;