Skip to content

Commit

Permalink
fixed : label disappear in workspace
Browse files Browse the repository at this point in the history
- closes : #5256
  • Loading branch information
MrSluffy committed Feb 14, 2025
1 parent 473121a commit a0b5a17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/com/android/launcher3/BubbleTextView.java
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,11 @@ public boolean shouldTextBeVisible() {
// Text should be visible everywhere but the hotseat.
Object tag = getParent() instanceof FolderIcon ? ((View) getParent()).getTag() : getTag();
ItemInfo info = tag instanceof ItemInfo ? (ItemInfo) tag : null;
return info == null || ((info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT
&& info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION)
&& !PreferenceExtensionsKt.firstBlocking(pref2.getEnableLabelInDock()));
if (info != null && (info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT
&& info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION)) {
return !PreferenceExtensionsKt.firstBlocking(pref2.getEnableLabelInDock());
}
return true;
}

public void setTextVisibility(boolean visible) {
Expand Down
10 changes: 6 additions & 4 deletions src/com/android/launcher3/CellLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,12 @@ public boolean addViewToCellLayout(View child, int index, int childId,
CellLayoutLayoutParams params, boolean markCells) {
final CellLayoutLayoutParams lp = params;

// Hotseat icons - remove text
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;
bubbleChild.setTextVisibility(PreferenceExtensionsKt.firstBlocking(pref.getEnableLabelInDock()));
// Hotseat icons - modified by lawnchair
if (child instanceof BubbleTextView bubbleChild) {
boolean enableLabel = mContainerType == HOTSEAT
? PreferenceExtensionsKt.firstBlocking(pref.getEnableLabelInDock())
: true;
bubbleChild.setTextVisibility(enableLabel);
}

child.setScaleX(DEFAULT_SCALE);
Expand Down
2 changes: 1 addition & 1 deletion src/com/android/launcher3/DeviceProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ private void updateHotseatSizes(int hotseatIconSizePx) {

hotseatCellHeightPx = getIconSizeWithOverlap(hotseatIconSizePx * 2) - hotseatIconSizePx / 2;
hotseatCellHeightPx += isLabelInDock ? iconTextHeight : 0;
hotseatQsbSpace += isLabelInDock ? iconTextHeight : 0;
hotseatQsbSpace += isLabelInDock ? (iconTextHeight / 2) : 0;

var space = Math.abs(hotseatCellHeightPx / 2) - 16;

Expand Down

0 comments on commit a0b5a17

Please sign in to comment.