summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-18 15:38:27 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-18 15:38:27 -0700
commit445e12fdb571cb7f2b13016ebcbd9f9119f249cc (patch)
treeed62075d34a9c268563c6ac780393098077da3cd
parent91a790754b24e8b44090498cd930fc74a79973a9 (diff)
parent031188dd0afa70670e338bd0cae06861cdd902e2 (diff)
Merge "Update Workspace App Icon Long-Press Menu's Text to Google Sans Flex" into main
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java7
-rw-r--r--src/com/android/launcher3/shortcuts/DeepShortcutTextView.java7
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 39f68bfe70..9a226df8db 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -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
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