Merge "Update Workspace App Icon Long-Press Menu's Text to Google Sans Flex" into main

This commit is contained in:
Treehugger Robot
2025-03-18 15:38:27 -07:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 0 deletions
@@ -24,7 +24,9 @@ import static com.android.launcher3.Utilities.squaredTouchSlop;
import static com.android.launcher3.allapps.AlphabeticalAppsList.PRIVATE_SPACE_PACKAGE;
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;
@@ -32,6 +34,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;
@@ -479,6 +482,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
@@ -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