fix: Compose QSB does not relinquish space when it's disabled (#6960)

Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach authored and GitHub committed 2026-07-09 15:25:54 +00:00
1 parent 2b169418f3
commit c3d1ba01f9
1 file changed
+12 -1
+12 -1
View File
@@ -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;