Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 706bd974 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Update the notif expand button so it can be shared" into sc-dev

parents 9cb260ac 10f23c1e
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line Diff line number Diff line
@@ -165,17 +165,25 @@ public class NotificationExpandButton extends FrameLayout {


    private void updateColors() {
    private void updateColors() {
        if (shouldShowNumber() && !mDisallowColor) {
        if (shouldShowNumber() && !mDisallowColor) {
            if (mHighlightPillColor != 0) {
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mHighlightPillColor));
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mHighlightPillColor));
            }
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mHighlightTextColor, PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mHighlightTextColor, PorterDuff.Mode.SRC_IN);
            if (mHighlightTextColor != 0) {
                mNumberView.setTextColor(mHighlightTextColor);
                mNumberView.setTextColor(mHighlightTextColor);
            }
        } else {
        } else {
            if (mDefaultPillColor != 0) {
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mDefaultPillColor));
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mDefaultPillColor));
            }
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mDefaultTextColor, PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mDefaultTextColor, PorterDuff.Mode.SRC_IN);
            if (mDefaultTextColor != 0) {
                mNumberView.setTextColor(mDefaultTextColor);
                mNumberView.setTextColor(mDefaultTextColor);
            }
            }
        }
        }
    }


    private boolean shouldShowNumber() {
    private boolean shouldShowNumber() {
        return !mExpanded && mNumber > 1;
        return !mExpanded && mNumber > 1;
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@
    android:layout_gravity="top|end"
    android:layout_gravity="top|end"
    android:contentDescription="@string/expand_button_content_description_collapsed"
    android:contentDescription="@string/expand_button_content_description_collapsed"
    android:padding="16dp"
    android:padding="16dp"
    android:visibility="gone"
    >
    >


    <LinearLayout
    <LinearLayout
@@ -40,6 +39,7 @@
            android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info"
            android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info"
            android:gravity="center_vertical"
            android:gravity="center_vertical"
            android:paddingStart="8dp"
            android:paddingStart="8dp"
            android:visibility="gone"
            />
            />


        <ImageView
        <ImageView
+2 −0
Original line number Original line Diff line number Diff line
@@ -4339,4 +4339,6 @@
  <java-symbol type="drawable" name="ic_accessibility_24dp" />
  <java-symbol type="drawable" name="ic_accessibility_24dp" />
  <java-symbol type="string" name="view_and_control_notification_title" />
  <java-symbol type="string" name="view_and_control_notification_title" />
  <java-symbol type="string" name="view_and_control_notification_content" />
  <java-symbol type="string" name="view_and_control_notification_content" />

  <java-symbol type="layout" name="notification_expand_button"/>
</resources>
</resources>