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

Commit 28d58706 authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Change how we set NotificationBackgroundView colors for row transparency" into main

parents a21468a7 1c6d3468
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -298,13 +298,8 @@ public class NotificationBackgroundView extends View implements Dumpable,
    public void setTint(int tintColor) {
        Drawable baseLayer = getBaseBackgroundLayer();
        if (notificationRowTransparency()) {
            // BG base layer being a drawable, there isn't a method like setColor() to color it.
            // Instead, we set a color filter that essentially replaces every pixel of the drawable.
            baseLayer.setColorFilter(
                    new PorterDuffColorFilter(
                            tintColor,
                            // SRC operator discards the drawable's color+alpha
                            PorterDuff.Mode.SRC));
            ((GradientDrawable) baseLayer.mutate()).setColor(tintColor);

        } else {
            baseLayer.mutate().setTintMode(PorterDuff.Mode.SRC_ATOP);
            baseLayer.setTint(tintColor);