From 0bd7a37971695c90641a6195453e95981108a6cf Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Mon, 5 Jun 2023 20:35:37 +0100 Subject: [PATCH] Correct AllApps horizontal padding There was one extra border space being added to handheld, which makes AllApps and Workspace icons to not align. Fix: 284151671 Test: DeviceProfileDumpTest Test: HomeScreenAllAppsImageTest Test: DeviceProfileResponsiveDumpTest Test: HomeScreenAllAppsImageTest Flag: N/A Change-Id: I6e4a0d93336a3c59db2a25805d90adfaf7a231cf --- src/com/android/launcher3/DeviceProfile.java | 3 ++- .../android/launcher3/nonquickstep/DeviceProfileDumpTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index c08dd1da36..620ce2acf1 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -854,7 +854,8 @@ public class DeviceProfile { allAppsLeftRightMargin = Math.max(1, (availableWidthPx - usedWidth) / 2); } else { allAppsLeftRightPadding = - desiredWorkspaceHorizontalMarginPx + cellLayoutHorizontalPadding; + Math.max(0, desiredWorkspaceHorizontalMarginPx + cellLayoutHorizontalPadding + - (allAppsBorderSpacePx.x / 2)); } } diff --git a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt index a81413e1d3..c91a4a9041 100644 --- a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt +++ b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt @@ -105,7 +105,7 @@ class DeviceProfileDumpTest : AbstractDeviceProfileTest() { "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + "\tnumShownAllAppsColumns: 5\n" + - "\tallAppsLeftRightPadding: 21.0px (8.0dp)\n" + + "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" + "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + "\thotseatBarSizePx: 294.0px (112.0dp)\n" + "\tinv.hotseatColumnSpan: 5\n" + @@ -241,7 +241,7 @@ class DeviceProfileDumpTest : AbstractDeviceProfileTest() { "\tallAppsBorderSpacePxX: 42.0px (16.0dp)\n" + "\tallAppsBorderSpacePxY: 42.0px (16.0dp)\n" + "\tnumShownAllAppsColumns: 5\n" + - "\tallAppsLeftRightPadding: 21.0px (8.0dp)\n" + + "\tallAppsLeftRightPadding: 0.0px (0.0dp)\n" + "\tallAppsLeftRightMargin: 0.0px (0.0dp)\n" + "\thotseatBarSizePx: 273.0px (104.0dp)\n" + "\tinv.hotseatColumnSpan: 5\n" +