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

Commit d14c60be authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev

parents 2c522a39 8d6f3cc1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5380,14 +5380,15 @@ public class Notification implements Parcelable

        private void bindExpandButton(RemoteViews contentView, StandardTemplateParams p) {
            // set default colors
            int textColor = getPrimaryTextColor(p);
            int pillColor = getColors(p).getProtectionColor();
            int bgColor = getBackgroundColor(p);
            int pillColor = Colors.flattenAlpha(getColors(p).getProtectionColor(), bgColor);
            int textColor = Colors.flattenAlpha(getPrimaryTextColor(p), pillColor);
            contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor);
            contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor);
            // Use different highlighted colors for conversations' unread count
            if (p.mHighlightExpander) {
                textColor = getBackgroundColor(p);
                pillColor = getPrimaryAccentColor(p);
                pillColor = Colors.flattenAlpha(getPrimaryAccentColor(p), bgColor);
                textColor = Colors.flattenAlpha(bgColor, pillColor);
            }
            contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor);
            contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor);
+2 −5
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.ColorInt;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.RemotableViewMethod;
@@ -159,8 +158,7 @@ public class NotificationExpandButton extends FrameLayout {
            if (mHighlightPillColor != 0) {
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mHighlightPillColor));
            }
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mHighlightTextColor, PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mHighlightTextColor);
            if (mHighlightTextColor != 0) {
                mNumberView.setTextColor(mHighlightTextColor);
            }
@@ -168,8 +166,7 @@ public class NotificationExpandButton extends FrameLayout {
            if (mDefaultPillColor != 0) {
                mPillView.setBackgroundTintList(ColorStateList.valueOf(mDefaultPillColor));
            }
            mPillView.setBackgroundTintMode(PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mDefaultTextColor, PorterDuff.Mode.SRC_IN);
            mIconView.setColorFilter(mDefaultTextColor);
            if (mDefaultTextColor != 0) {
                mNumberView.setTextColor(mDefaultTextColor);
            }