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

Commit faa70d2a authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "[RONs] Update notification colors" into main

parents 50b3c930 d2c8e770
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -14818,12 +14818,23 @@ public class Notification implements Parcelable
                } else {
                    mBackgroundColor = rawColor;
                }
                if (Flags.uiRichOngoing()) {
                    boolean isBgDark = Notification.Builder.isColorDark(mBackgroundColor);
                    int onSurfaceColorExtreme = isBgDark ? Color.WHITE : Color.BLACK;
                    mPrimaryTextColor = ContrastColorUtil.ensureContrast(
                            ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.9f),
                            mBackgroundColor, isBgDark, 4.5);
                    mSecondaryTextColor = ContrastColorUtil.ensureContrast(
                            ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.8f),
                            mBackgroundColor, isBgDark, 4.5);
                } else {
                    mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast(
                            ContrastColorUtil.resolvePrimaryColor(ctx, mBackgroundColor, nightMode),
                            mBackgroundColor, 4.5);
                    mSecondaryTextColor = ContrastColorUtil.findAlphaToMeetContrast(
                        ContrastColorUtil.resolveSecondaryColor(ctx, mBackgroundColor, nightMode),
                        mBackgroundColor, 4.5);
                            ContrastColorUtil.resolveSecondaryColor(ctx,
                                    mBackgroundColor, nightMode), mBackgroundColor, 4.5);
                }
                mContrastColor = mPrimaryTextColor;
                mPrimaryAccentColor = mPrimaryTextColor;
                mSecondaryAccentColor = mSecondaryTextColor;