diff options
author | 2025-03-17 17:42:58 -0700 | |
---|---|---|
committer | 2025-03-17 17:56:31 -0700 | |
commit | 031188dd0afa70670e338bd0cae06861cdd902e2 (patch) | |
tree | 34e61a3106e6afaf37fa81aaa8a4e8dc41d58866 /src | |
parent | 6aaec1a019f5d750e7540c0357193cf32df34947 (diff) |
Update Workspace App Icon Long-Press Menu's Text to Google Sans Flex
Bug: 393615290
Test: Verified via hard-coding flag to be true that fonts were correctly updated.
Flag: com.android.wm.shell.enable_gsf
Change-Id: I9ff1405356a4ceb2930b09f27e973e4cacb72d2e
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/shortcuts/DeepShortcutTextView.java | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index aad1400865..ea83295acd 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -21,7 +21,9 @@ import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredTouchSlop; import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; +import static com.android.launcher3.shortcuts.DeepShortcutTextView.GOOGLE_SANS_FLEX_LABEL_LARGE; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; +import static com.android.wm.shell.Flags.enableGsf; import android.animation.AnimatorSet; import android.animation.LayoutTransition; @@ -29,6 +31,7 @@ import android.content.Context; import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; +import android.graphics.Typeface; import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; @@ -472,6 +475,10 @@ public class PopupContainerWithArrow<T extends Context & ActivityContext> if (view instanceof DeepShortcutView) { // System shortcut takes entire row with icon and text final DeepShortcutView shortcutView = (DeepShortcutView) view; + if (enableGsf()) { + shortcutView.getBubbleText().setTypeface( + Typeface.create(GOOGLE_SANS_FLEX_LABEL_LARGE, Typeface.NORMAL)); + } info.setIconAndLabelFor(shortcutView.getIconView(), shortcutView.getBubbleText()); } else if (view instanceof ImageView) { // System shortcut is just an icon diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java index ded2ceee42..b1d095b52e 100644 --- a/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java +++ b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java @@ -16,9 +16,12 @@ package com.android.launcher3.shortcuts; +import static com.android.wm.shell.Flags.enableGsf; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; +import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.AttributeSet; @@ -31,6 +34,7 @@ import com.android.launcher3.Utilities; * A {@link BubbleTextView} that has the shortcut icon on the left and drag handle on the right. */ public class DeepShortcutTextView extends BubbleTextView { + public static final String GOOGLE_SANS_FLEX_LABEL_LARGE = "variable-label-large"; private boolean mShowLoadingState; private Drawable mLoadingStatePlaceholder; @@ -47,6 +51,9 @@ public class DeepShortcutTextView extends BubbleTextView { public DeepShortcutTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); showLoadingState(true); + if (enableGsf()) { + setTypeface(Typeface.create(GOOGLE_SANS_FLEX_LABEL_LARGE, Typeface.NORMAL)); + } } @Override |