summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2021-03-24 00:49:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-03-24 00:49:53 +0000
commit76ae4090e1185f4f03a13196f5fcd03bedce3e90 (patch)
tree026946a2e6bb015f879442a3698727c022a89924 /core/java
parent0b296ebdbe208460684957aaeccc463957bc38d4 (diff)
parentb904a2e608e28f1d6d81b17af56639326521f077 (diff)
Merge "Change color of expand button on notif groups" into sc-dev
Diffstat (limited to 'core/java')
-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 64729135d35e..420ec0846fda 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5283,8 +5283,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);
@@ -6219,6 +6218,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) {