diff --git a/GITHUB_CHANGELOG.md b/GITHUB_CHANGELOG.md index 20b3d57ab6..33b3c3e799 100644 --- a/GITHUB_CHANGELOG.md +++ b/GITHUB_CHANGELOG.md @@ -24,6 +24,10 @@ Compatibility list: * [Lawnchair/Iconloaderlib] Reimplement custom app name * [Lawnchair] Reimplement Launcher3 debug page * [Lawnchair] Reimplement Caddy and App drawer folder +* [Lawnchair] Reimplement Hotseat toggle +* [Lawnchair] Reimplement Favorite application label +* [Lawnchair] Hotseat positioning with favorite icon label enabled placed the same even if label is disabled +* [Lawnchair] Hotseat background now have a reasonably sized margin compared to D2 ### Development 2 diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index d527056b53..2b25551462 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1024,20 +1024,39 @@ public class DeviceProfile { /** Updates hotseatCellHeightPx and hotseatBarSizePx */ private void updateHotseatSizes(int hotseatIconSizePx) { + int iconTextHeight = Utilities.calculateTextHeight(iconTextSizePx); + boolean isLabelInDock = PreferenceExtensionsKt.firstBlocking(preferenceManager2.getEnableLabelInDock()); // Ensure there is enough space for folder icons, which have a slightly larger radius. - hotseatCellHeightPx = getIconSizeWithOverlap(hotseatIconSizePx); + hotseatCellHeightPx = getIconSizeWithOverlap(hotseatIconSizePx * 2) - hotseatIconSizePx / 2; + hotseatCellHeightPx += isLabelInDock ? iconTextHeight : 0; + hotseatQsbSpace += isLabelInDock ? (iconTextHeight / 2) : 0; + + int space = Math.abs(hotseatCellHeightPx / 2) - 16; + if (!isLabelInDock) { + space -= iconTextHeight; + } + + hotseatBarBottomSpacePx *= PreferenceExtensionsKt + .firstBlocking(preferenceManager2.getHotseatBottomFactor()); if (isVerticalBarLayout()) { hotseatBarSizePx = hotseatIconSizePx + mHotseatBarEdgePaddingPx - + mHotseatBarWorkspaceSpacePx; + + mHotseatBarWorkspaceSpacePx + + space; } else if (isQsbInline) { hotseatBarSizePx = Math.max(hotseatIconSizePx, hotseatQsbVisualHeight) - + hotseatBarBottomSpacePx; + + hotseatBarBottomSpacePx + + space; } else { hotseatBarSizePx = hotseatIconSizePx + hotseatQsbSpace + hotseatQsbVisualHeight - + hotseatBarBottomSpacePx; + + hotseatBarBottomSpacePx + + space; + } + var isHotseatEnabled = PreferenceExtensionsKt.firstBlocking(preferenceManager2.isHotseatEnabled()); + if (!isHotseatEnabled) { + hotseatBarSizePx = 0; } }