From f2b2202bd80961ff258ce82d376ecd402ec94d16 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Fri, 8 Sep 2023 15:25:47 -0700 Subject: [PATCH] Fix the badge in badge (triple badging), by simply removing the user badge (FLAG_SKIP_USER_BADGE). This is used in the bigIconRow where we remove the workBadge in the icon and put the icon after the title in BIG_ICON_ROW. bug:276957152 Flag: n/a Test: manual - before: https://screenshot.googleplex.com/BXShenE2kGrZXtF after: https://screenshot.googleplex.com/AVYxpDyJ7JGet8h Change-Id: Icefb9c8192d9841c95c8f6d628026f336e0b7195 --- src/com/android/launcher3/BubbleTextView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index ddcb1e629c..883c379f5d 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -22,6 +22,7 @@ import static com.android.launcher3.Flags.enableCursorHoverStates; import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING; import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon; import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE; +import static com.android.launcher3.icons.BitmapInfo.FLAG_SKIP_USER_BADGE; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound; import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_INCREMENTAL_DOWNLOAD_ACTIVE; @@ -164,6 +165,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, @ViewDebug.ExportedProperty(category = "launcher") private boolean mHideBadge = false; @ViewDebug.ExportedProperty(category = "launcher") + private boolean mSkipUserBadge = false; + @ViewDebug.ExportedProperty(category = "launcher") private boolean mIsIconVisible = true; @ViewDebug.ExportedProperty(category = "launcher") private int mTextColor; @@ -266,6 +269,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, mHideBadge = hideBadge; } + public void setSkipUserBadge(boolean skipUserBadge) { + mSkipUserBadge = skipUserBadge; + } + /** * Resets the view so it can be recycled. */ @@ -395,6 +402,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, if (mHideBadge || mDisplay == DISPLAY_SEARCH_RESULT_SMALL) { flags |= FLAG_NO_BADGE; } + if (mSkipUserBadge) { + flags |= FLAG_SKIP_USER_BADGE; + } FastBitmapDrawable iconDrawable = info.newIcon(getContext(), flags); mDotParams.appColor = iconDrawable.getIconColor(); mDotParams.dotColor = Themes.getAttrColor(getContext(), R.attr.notificationDotColor);