From 72171629e620e539e93c258987435fdb8be7a41e Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Fri, 27 Jan 2017 10:32:06 -0800 Subject: [PATCH] Notification: Fix Ambient view text color Change-Id: Ib45e2288932939896bb05fc1dc606e3551dd951d Test: Trigger Ambient Display, check text is readable. Fixes: 34767438 --- core/java/android/app/Notification.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 7bdf4cc158522..80f4985979679 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3498,7 +3498,9 @@ public class Notification implements Parcelable if (p.title != null) { contentView.setViewVisibility(R.id.title, View.VISIBLE); contentView.setTextViewText(R.id.title, p.title); - setTextViewColorPrimary(contentView, R.id.title); + if (!p.ambient) { + setTextViewColorPrimary(contentView, R.id.title); + } contentView.setViewLayoutWidth(R.id.title, showProgress ? ViewGroup.LayoutParams.WRAP_CONTENT : ViewGroup.LayoutParams.MATCH_PARENT); @@ -3507,7 +3509,9 @@ public class Notification implements Parcelable int textId = showProgress ? com.android.internal.R.id.text_line_1 : com.android.internal.R.id.text; contentView.setTextViewText(textId, p.text); - setTextViewColorSecondary(contentView, textId); + if (!p.ambient) { + setTextViewColorSecondary(contentView, textId); + } contentView.setViewVisibility(textId, View.VISIBLE); } @@ -3715,7 +3719,7 @@ public class Notification implements Parcelable } private void bindHeaderAppName(RemoteViews contentView, boolean ambient) { contentView.setTextViewText(R.id.app_name_text, loadHeaderAppName()); - if (isColorized()) { + if (isColorized() && !ambient) { setTextViewColorPrimary(contentView, R.id.app_name_text); } else { contentView.setTextColor(R.id.app_name_text, @@ -4067,7 +4071,7 @@ public class Notification implements Parcelable } } else { button.setTextViewText(R.id.action0, processLegacyText(action.title)); - if (isColorized()) { + if (isColorized() && !ambient) { setTextViewColorPrimary(button, R.id.action0); } else if (mN.color != COLOR_DEFAULT) { button.setTextColor(R.id.action0,