summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2021-03-22 19:00:54 -0700
committer Lucas Dupin <dupin@google.com> 2021-03-23 15:49:21 -0700
commitb904a2e608e28f1d6d81b17af56639326521f077 (patch)
treef6fd60636b5b042ce357258a03548451b13840bf
parent358a76f7e489c8af53a1b59e6d86ccafe887083a (diff)
Change color of expand button on notif groups
They should use the tertiary accent color. Fixes: 183454454 Test: visual Change-Id: Ieb1fdfb15a9b74c77880ae7bfad19549e23f9396
-rw-r--r--core/java/android/app/Notification.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 5dd10f10930b..f81003e7e67a 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5354,8 +5354,7 @@ public class Notification implements Parcelable
contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor);
// Use different highlighted colors except when low-priority mode prevents that
if (!p.mReduceHighlights) {
- textColor = getBackgroundColor(p);
- pillColor = getAccentColor(p);
+ pillColor = getAccentTertiaryColor(p);
}
contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor);
contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor);
@@ -6300,6 +6299,25 @@ public class Notification implements Parcelable
}
/**
+ * Gets the tertiary accent color for colored UI elements. If we're tinting with the theme
+ * accent, this comes from the tertiary system accent palette, otherwise this would be
+ * identical to {@link #getSmallIconColor(StandardTemplateParams)}.
+ */
+ private @ColorInt int getAccentTertiaryColor(StandardTemplateParams p) {
+ if (isColorized(p)) {
+ return getPrimaryTextColor(p);
+ }
+ if (mTintWithThemeAccent) {
+ int color = obtainThemeColor(com.android.internal.R.attr.colorAccentTertiary,
+ COLOR_INVALID);
+ if (color != COLOR_INVALID) {
+ return color;
+ }
+ }
+ return getContrastColor(p);
+ }
+
+ /**
* Gets the theme's error color, or the primary text color for colorized notifications.
*/
private @ColorInt int getErrorColor(StandardTemplateParams p) {