summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ana Salazar Maldonado <anasalazar@google.com> 2025-02-28 11:23:44 -0800
committer Ana Salazar Maldonado <anasalazar@google.com> 2025-02-28 11:23:44 -0800
commitd4cce41c2796326a8e7d821912bb18a141e9c2f3 (patch)
tree0a5331ce8a0e75a9670effe3cf36761c4122a6e5
parentaee4b11336732b95517333240cdd140d0f8acdaa (diff)
Fix tokens for App Contrast Pill
Bug: 397101795 Test: update screenshots Flag: com.android.launcher3.enable_contrast_tiles Change-Id: Iffe86d8b1bdebbf8ddab9dcfd6197ad24edb684f
-rw-r--r--src/com/android/launcher3/BubbleTextView.java13
-rw-r--r--src/com/android/launcher3/PillColorPorovider.kt9
2 files changed, 10 insertions, 12 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index bd42b2b855..edd81cd5c2 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -961,11 +961,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
@Override
public void setTextColor(ColorStateList colors) {
- mTextColor = (shouldDrawAppContrastTile() && !TextUtils.isEmpty(getText()))
- ? PillColorProvider.getInstance(
- getContext()).getAppTitleTextPaint().getColor()
- : colors.getDefaultColor();
- mTextColorStateList = colors;
+ if (shouldDrawAppContrastTile()) {
+ mTextColor = PillColorProvider.getInstance(
+ getContext()).getAppTitleTextPaint().getColor();
+ } else {
+ mTextColor = colors.getDefaultColor();
+ mTextColorStateList = colors;
+ }
+
if (Float.compare(mTextAlpha, 1) == 0) {
super.setTextColor(colors);
} else {
diff --git a/src/com/android/launcher3/PillColorPorovider.kt b/src/com/android/launcher3/PillColorPorovider.kt
index 347c5d6581..e7f37bd40d 100644
--- a/src/com/android/launcher3/PillColorPorovider.kt
+++ b/src/com/android/launcher3/PillColorPorovider.kt
@@ -58,13 +58,8 @@ class PillColorProvider private constructor(c: Context) {
}
fun setup() {
- appTitlePillPaint.color =
- context.resources.getColor(
- R.color.material_color_surface_container_lowest,
- context.theme,
- )
- appTitleTextPaint.color =
- context.resources.getColor(R.color.material_color_on_surface, context.theme)
+ appTitlePillPaint.color = context.getColor(R.color.materialColorSurfaceContainer)
+ appTitleTextPaint.color = context.getColor(R.color.materialColorOnSurface)
isMatchaEnabledInternal = Settings.Secure.getInt(context.contentResolver, MATCHA_SETTING, 0)
isMatchaEnabled = isMatchaEnabledInternal != 0
}