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

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

Merge "Revert "Avoid adding transparency to Shelf Background View"" into main

parents c797432f afb2fe0b
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
@@ -86,7 +87,7 @@ public class NotificationBackgroundView extends View implements Dumpable,
                R.color.notification_state_color_light);
        mDarkColoredStatefulColors = getResources().getColorStateList(
                R.color.notification_state_color_dark);
        if (backgroundTransparency()) {
        if (notificationRowTransparency()) {
            mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext());
        } else  {
            mNormalColor = mContext.getColor(
@@ -107,13 +108,6 @@ public class NotificationBackgroundView extends View implements Dumpable,
        }
    }

    /**
     * @return Whether to apply transparency to the background.
     */
    protected boolean backgroundTransparency() {
        return notificationRowTransparency();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        float clipTop = Math.max(mClipTopAmount, mTopOverlap);
@@ -307,7 +301,7 @@ public class NotificationBackgroundView extends View implements Dumpable,

    public void setTint(int tintColor) {
        Drawable baseLayer = getBaseBackgroundLayer();
        if (backgroundTransparency()) {
        if (notificationRowTransparency()) {
            ((GradientDrawable) baseLayer.mutate()).setColor(tintColor);

        } else {
+0 −4
Original line number Diff line number Diff line
@@ -43,8 +43,4 @@ constructor(context: Context, attrs: AttributeSet? = null) :
    override fun toDumpString(): String {
        return super.toDumpString() + " alignToEnd=" + alignToEnd
    }

    override fun backgroundTransparency(): Boolean {
        return false
    }
}