From 1557ba37c1ea5b2b553f427ce4bd532943700874 Mon Sep 17 00:00:00 2001 From: James O'Leary Date: Wed, 4 May 2022 16:49:03 +0000 Subject: [PATCH] Separate color into app color and dot color; specify dot color Design intends for predicted app disc to use the app color, and the dot to use tertiary T90/shade100. Both currently use `color`. Separating into two separate colors lets use define the two separate colors requested by design. Bug: 213314628 Test: Manual inspection at runtime Change-Id: If50c32d0bf67493192ce32a33775311d58f21942 --- .../android/launcher3/uioverrides/PredictedAppIcon.java | 2 +- src/com/android/launcher3/BubbleTextView.java | 7 +++++-- src/com/android/launcher3/folder/FolderIcon.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index 351ec4a1b1..5f3a990750 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -180,7 +180,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { : null; super.applyFromWorkspaceItem(info, animate, staggerIndex); int oldPlateColor = mPlateColor; - int newPlateColor = ColorUtils.setAlphaComponent(mDotParams.color, 200); + int newPlateColor = ColorUtils.setAlphaComponent(mDotParams.appColor, 200); if (!animate) { mPlateColor = newPlateColor; } diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 6302739bc5..bb18113e57 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -253,7 +253,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, */ public void reset() { mDotInfo = null; - mDotParams.color = Color.TRANSPARENT; + mDotParams.dotColor = Color.TRANSPARENT; + mDotParams.appColor = Color.TRANSPARENT; cancelDotScaleAnim(); mDotParams.scale = 0f; mForceHideDot = false; @@ -381,7 +382,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, flags |= FLAG_NO_BADGE; } FastBitmapDrawable iconDrawable = info.newIcon(getContext(), flags); - mDotParams.color = iconDrawable.getIconColor(); + mDotParams.appColor = iconDrawable.getIconColor(); + mDotParams.dotColor = getContext().getResources() + .getColor(android.R.color.system_accent3_100, getContext().getTheme()); setIcon(iconDrawable); applyLabel(info); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 5fe2435e4a..e0ab42a13b 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -637,7 +637,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel // If we are animating to the accepting state, animate the dot out. mDotParams.scale = Math.max(0, mDotScale - mBackground.getScaleProgress()); - mDotParams.color = mBackground.getDotColor(); + mDotParams.dotColor = mBackground.getDotColor(); mDotRenderer.draw(canvas, mDotParams); } }