From 10f23c1e9b772ee99fcb8c6b2a266419752cddbf Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 13 Apr 2021 22:53:01 -0400 Subject: [PATCH] Update the notif expand button so it can be shared .. with notification history Test: manual Bug: 184695652 Change-Id: Iaa61d2442539ee42ec776530b84bf98c76e038a9 --- .../widget/NotificationExpandButton.java | 16 ++++++++++++---- .../res/layout/notification_expand_button.xml | 2 +- core/res/res/values/symbols.xml | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/core/java/com/android/internal/widget/NotificationExpandButton.java b/core/java/com/android/internal/widget/NotificationExpandButton.java index 7a8ead6b33f13..de3b6a4dacb2b 100644 --- a/core/java/com/android/internal/widget/NotificationExpandButton.java +++ b/core/java/com/android/internal/widget/NotificationExpandButton.java @@ -165,15 +165,23 @@ public class NotificationExpandButton extends FrameLayout { private void updateColors() { if (shouldShowNumber() && !mDisallowColor) { - mPillView.setBackgroundTintList(ColorStateList.valueOf(mHighlightPillColor)); + if (mHighlightPillColor != 0) { + mPillView.setBackgroundTintList(ColorStateList.valueOf(mHighlightPillColor)); + } mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN); mIconView.setColorFilter(mHighlightTextColor, PorterDuff.Mode.SRC_IN); - mNumberView.setTextColor(mHighlightTextColor); + if (mHighlightTextColor != 0) { + mNumberView.setTextColor(mHighlightTextColor); + } } else { - mPillView.setBackgroundTintList(ColorStateList.valueOf(mDefaultPillColor)); + if (mDefaultPillColor != 0) { + mPillView.setBackgroundTintList(ColorStateList.valueOf(mDefaultPillColor)); + } mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN); mIconView.setColorFilter(mDefaultTextColor, PorterDuff.Mode.SRC_IN); - mNumberView.setTextColor(mDefaultTextColor); + if (mDefaultTextColor != 0) { + mNumberView.setTextColor(mDefaultTextColor); + } } } diff --git a/core/res/res/layout/notification_expand_button.xml b/core/res/res/layout/notification_expand_button.xml index b969fa49bcc79..e752431ce75fb 100644 --- a/core/res/res/layout/notification_expand_button.xml +++ b/core/res/res/layout/notification_expand_button.xml @@ -22,7 +22,6 @@ android:layout_gravity="top|end" android:contentDescription="@string/expand_button_content_description_collapsed" android:padding="16dp" - android:visibility="gone" > + +