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

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

Merge "Fix notification group header color flickers" into main

parents 9e9c8e00 719136d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -128,7 +128,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        updateColors();
        updateColors();
    }
    }


    private void updateColors() {
    protected void updateColors() {
        if (notificationRowTransparency()) {
        if (notificationRowTransparency()) {
            if (mIsBlurSupported) {
            if (mIsBlurSupported) {
                mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext());
                mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext());
+5 −8
Original line number Original line Diff line number Diff line
@@ -979,7 +979,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        } else if (isAboveShelf() != wasAboveShelf) {
        } else if (isAboveShelf() != wasAboveShelf) {
            mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
            mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
        }
        }
        updateBackgroundOpacity();
        updateColors();
    }
    }


    /**
    /**
@@ -3121,7 +3121,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                    mChildrenContainer.setOnKeyguard(onKeyguard);
                    mChildrenContainer.setOnKeyguard(onKeyguard);
                }
                }
            }
            }
            updateBackgroundOpacity();
            updateColors();
        }
        }
    }
    }


@@ -4630,11 +4630,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        }
    }
    }


    private void updateBackgroundOpacity() {
    @Override
        if (mBackgroundNormal != null) {
    protected boolean usesTransparentBackground() {
            // Row background should be opaque when it's displayed as a heads-up notification or
        return super.usesTransparentBackground() && !mIsHeadsUp && !mOnKeyguard;
            // displayed on keyguard.
            mBackgroundNormal.setForceOpaque(mIsHeadsUp || mOnKeyguard);
        }
    }
    }
}
}
+1 −13
Original line number Original line Diff line number Diff line
@@ -39,7 +39,6 @@ import androidx.annotation.Nullable;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.util.ContrastColorUtil;
import com.android.internal.util.ContrastColorUtil;
import com.android.systemui.Dumpable;
import com.android.systemui.Dumpable;
import com.android.systemui.common.shared.colors.SurfaceEffectColors;
import com.android.systemui.res.R;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.notification.shared.NotificationAddXOnHoverToDismiss;
import com.android.systemui.statusbar.notification.shared.NotificationAddXOnHoverToDismiss;
import com.android.systemui.util.DrawableDumpKt;
import com.android.systemui.util.DrawableDumpKt;
@@ -156,14 +155,6 @@ public class NotificationBackgroundView extends View implements Dumpable,
        mBgIsColorized = b;
        mBgIsColorized = b;
    }
    }


    /** Sets if the background should be opaque. */
    public void setForceOpaque(boolean forceOpaque) {
        mForceOpaque = forceOpaque;
        if (notificationRowTransparency()) {
            updateBaseLayerColor();
        }
    }

    private Path calculateDismissButtonCutoutPath(Rect backgroundBounds) {
    private Path calculateDismissButtonCutoutPath(Rect backgroundBounds) {
        // TODO(b/365585705): Adapt to RTL after the UX design is finalized.
        // TODO(b/365585705): Adapt to RTL after the UX design is finalized.


@@ -327,10 +318,7 @@ public class NotificationBackgroundView extends View implements Dumpable,
        // For colorized notifications, this uses a color that matches the tint color at 90% alpha.
        // For colorized notifications, this uses a color that matches the tint color at 90% alpha.
        int color = isColorized()
        int color = isColorized()
                ? ColorUtils.setAlphaComponent(mTintColor, (int) (MAX_ALPHA * 0.9f))
                ? ColorUtils.setAlphaComponent(mTintColor, (int) (MAX_ALPHA * 0.9f))
                : SurfaceEffectColors.surfaceEffect1(getContext());
                : mNormalColor;
        if (mForceOpaque) {
            color = ColorUtils.setAlphaComponent(color, MAX_ALPHA);
        }
        getBaseBackgroundLayer().setColorFilter(
        getBaseBackgroundLayer().setColorFilter(
                new PorterDuffColorFilter(
                new PorterDuffColorFilter(
                        color,
                        color,