feat: Reimplement Hotseat, and Favorite application label toggle
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user