From c3d1ba01f93ac09e42586339730529c09380cb38 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Thu, 9 Jul 2026 22:25:54 +0700 Subject: [PATCH] fix: Compose QSB does not relinquish space when it's disabled (#6960) Signed-off-by: Pun Butrach --- src/com/android/launcher3/DeviceProfile.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 78963ca025..bb115b1125 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -269,6 +269,8 @@ public class DeviceProfile { // DragController public int flingToDeleteThresholdVelocity; + private int mHotseatQsbSpaceBase; // LC-Note: This is to keep QSB space as a reference to be used later. + /** Used only as an alternative to mocking when null values cannot be used. */ @VisibleForTesting public DeviceProfile() { @@ -541,6 +543,10 @@ public class DeviceProfile { hotseatBarBottomSpace = pxFromDp(inv.hotseatBarBottomSpace[mTypeIndex], mMetrics); } + if (!isQsbEnable) { + hotseatQsbSpace = 0; + } + hotseatProfile = HotseatProfile.Factory.createHotseatProfile( getDeviceProperties(), res, @@ -583,6 +589,8 @@ public class DeviceProfile { } } + mHotseatQsbSpaceBase = hotseatQsbSpace; + if (mIsResponsiveGrid) { updateHotseatSizes(mResponsiveWorkspaceCellSpec.getIconSize()); } else { @@ -881,10 +889,13 @@ public class DeviceProfile { private void updateHotseatSizes(int hotseatIconSizePx) { int iconTextHeight = Utilities.calculateTextHeight(iconTextSizePx); boolean isLabelInDock = PreferenceCacheExtensionsKt.firstCached(preferenceManager2.getEnableLabelInDock()); + HotseatMode hotseatMode = PreferenceCacheExtensionsKt.firstCached(preferenceManager2.getHotseatMode()); + boolean isQsbEnable = hotseatMode.getLayoutResourceId() != R.layout.empty_view; // Ensure there is enough space for folder icons, which have a slightly larger radius. hotseatCellHeightPx = getIconSizeWithOverlap(hotseatIconSizePx * 2) - hotseatIconSizePx / 2; hotseatCellHeightPx += isLabelInDock ? iconTextHeight : 0; - hotseatQsbSpace += isLabelInDock ? (iconTextHeight / 2) : 0; + hotseatQsbSpace = mHotseatQsbSpaceBase; + hotseatQsbSpace += isQsbEnable && isLabelInDock ? (iconTextHeight / 2) : 0; int space = Math.abs(hotseatCellHeightPx / 2) - 16;