diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index b3fca366ea1e7..c36f7cd630a9d 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -171,10 +171,10 @@ #ffffffff - @color/GM2_grey_700 + @*android:color/notification_primary_text_color_light @*android:color/notification_primary_text_color_dark #ffffffff - #ffdadce0 + @*android:color/accent_device_default #80000000 diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java index 88cf2db527f08..d3065aa36a5fa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java @@ -876,10 +876,12 @@ public class NotificationContentView extends FrameLayout { public void setBackgroundTintColor(int color) { if (mExpandedSmartReplyView != null) { - mExpandedSmartReplyView.setBackgroundTintColor(color); + boolean colorized = mNotificationEntry.getSbn().getNotification().isColorized(); + mExpandedSmartReplyView.setBackgroundTintColor(color, colorized); } if (mHeadsUpSmartReplyView != null) { - mHeadsUpSmartReplyView.setBackgroundTintColor(color); + boolean colorized = mNotificationEntry.getSbn().getNotification().isColorized(); + mHeadsUpSmartReplyView.setBackgroundTintColor(color, colorized); } } @@ -1509,7 +1511,9 @@ public class NotificationContentView extends FrameLayout { smartReplyView.addPreInflatedButtons( inflatedSmartReplyViewHolder.getSmartSuggestionButtons()); // Ensure the colors of the smart suggestion buttons are up-to-date. - smartReplyView.setBackgroundTintColor(entry.getRow().getCurrentBackgroundTint()); + int backgroundColor = entry.getRow().getCurrentBackgroundTint(); + boolean colorized = mNotificationEntry.getSbn().getNotification().isColorized(); + smartReplyView.setBackgroundTintColor(backgroundColor, colorized); smartReplyContainer.setVisibility(View.VISIBLE); } return smartReplyView; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java index ad4fa64ac905d..edec61832c8e5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java @@ -92,6 +92,7 @@ public class SmartReplyView extends ViewGroup { @ColorInt private int mCurrentStrokeColor; @ColorInt private int mCurrentTextColor; @ColorInt private int mCurrentRippleColor; + private boolean mCurrentColorized; private int mMaxSqueezeRemeasureAttempts; private int mMaxNumActions; private int mMinNumSystemGeneratedReplies; @@ -143,7 +144,7 @@ public class SmartReplyView extends ViewGroup { mBreakIterator = BreakIterator.getLineInstance(); - setBackgroundTintColor(mDefaultBackgroundColor); + setBackgroundTintColor(mDefaultBackgroundColor, false /* colorized */); reallocateCandidateButtonQueueForSqueezing(); } @@ -182,7 +183,7 @@ public class SmartReplyView extends ViewGroup { public void resetSmartSuggestions(View newSmartReplyContainer) { mSmartReplyContainer = newSmartReplyContainer; removeAllViews(); - setBackgroundTintColor(mDefaultBackgroundColor); + setBackgroundTintColor(mDefaultBackgroundColor, false /* colorized */); } /** Add buttons to the {@link SmartReplyView} */ @@ -676,19 +677,24 @@ public class SmartReplyView extends ViewGroup { return lp.show && super.drawChild(canvas, child, drawingTime); } - public void setBackgroundTintColor(int backgroundColor) { - if (backgroundColor == mCurrentBackgroundColor) { + /** + * Set the current background color of the notification so that the smart reply buttons can + * match it, and calculate other colors (e.g. text, ripple, stroke) + */ + public void setBackgroundTintColor(int backgroundColor, boolean colorized) { + if (backgroundColor == mCurrentBackgroundColor && colorized == mCurrentColorized) { // Same color ignoring. return; } mCurrentBackgroundColor = backgroundColor; + mCurrentColorized = colorized; final boolean dark = !ContrastColorUtil.isColorLight(backgroundColor); mCurrentTextColor = ContrastColorUtil.ensureTextContrast( dark ? mDefaultTextColorDarkBg : mDefaultTextColor, backgroundColor | 0xff000000, dark); - mCurrentStrokeColor = ContrastColorUtil.ensureContrast( + mCurrentStrokeColor = colorized ? mCurrentTextColor : ContrastColorUtil.ensureContrast( mDefaultStrokeColor, backgroundColor | 0xff000000, dark, mMinStrokeContrast); mCurrentRippleColor = dark ? mRippleColorDarkBg : mRippleColor;