From ef2be673a0e721e8b43834ef75d861073ea32b97 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Thu, 10 Apr 2025 10:29:58 -0700 Subject: [PATCH] Make hotseat icons match with Workspace in Fixed Landscape Bug: 409784022 Test: Screenshot tests Test: DumptTest Flag: EXEMPT bug fix Change-Id: I12b9699b1dc9ba597511be8e929cc8cf1bde7756 --- src/com/android/launcher3/DeviceProfile.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 88aa445dfc..507cc5aef2 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1938,8 +1938,12 @@ public class DeviceProfile { } else if (inv.isFixedLandscape) { // Center the QSB vertically with hotseat int hotseatBarBottomPadding = getHotseatBarBottomPadding(); - int hotseatPlusQSBWidth = getHotseatRequiredWidth(); - int qsbWidth = getAdditionalQsbSpace(); + int hotseatPlusQSBWidth = getIconToIconWidthForColumns(inv.numColumns); + + // This is needed because of b/235886078 since QSB needs to span to the icon borders + int iconExtraSpacePx = iconSizePx - getIconVisibleSizePx(iconSizePx); + int qsbWidth = getAdditionalQsbSpace() + iconExtraSpacePx / 2; + int availableWidthPxForHotseat = availableWidthPx - Math.abs(workspacePadding.width()) - Math.abs(cellLayoutPaddingPx.width()); int remainingSpaceOnSide = (availableWidthPxForHotseat - hotseatPlusQSBWidth) / 2;