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

Commit 5403481c authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge "Change Notification expander to use 10% opaque foreground color" into...

Merge "Change Notification expander to use 10% opaque foreground color" into udc-qpr-dev am: a21164e9 am: e84f770b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24358096



Change-Id: Ie620cbd62a2f33153106a4c9fbb30a8ed9fc0839
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c44200f5 e84f770b
Loading
Loading
Loading
Loading
+9 −14
Original line number Diff line number Diff line
@@ -12819,7 +12819,6 @@ public class Notification implements Parcelable
                } else {
                    mBackgroundColor = rawColor;
                }
                mProtectionColor = COLOR_INVALID;  // filled in at the end
                mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast(
                        ContrastColorUtil.resolvePrimaryColor(ctx, mBackgroundColor, nightMode),
                        mBackgroundColor, 4.5);
@@ -12836,7 +12835,6 @@ public class Notification implements Parcelable
            } else {
                int[] attrs = {
                        R.attr.colorSurface,
                        R.attr.colorBackgroundFloating,
                        R.attr.textColorPrimary,
                        R.attr.textColorSecondary,
                        R.attr.colorAccent,
@@ -12848,15 +12846,14 @@ public class Notification implements Parcelable
                };
                try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
                    mBackgroundColor = getColor(ta, 0, nightMode ? Color.BLACK : Color.WHITE);
                    mProtectionColor = getColor(ta, 1, COLOR_INVALID);
                    mPrimaryTextColor = getColor(ta, 2, COLOR_INVALID);
                    mSecondaryTextColor = getColor(ta, 3, COLOR_INVALID);
                    mPrimaryAccentColor = getColor(ta, 4, COLOR_INVALID);
                    mSecondaryAccentColor = getColor(ta, 5, COLOR_INVALID);
                    mTertiaryAccentColor = getColor(ta, 6, COLOR_INVALID);
                    mOnAccentTextColor = getColor(ta, 7, COLOR_INVALID);
                    mErrorColor = getColor(ta, 8, COLOR_INVALID);
                    mRippleAlpha = Color.alpha(getColor(ta, 9, 0x33ffffff));
                    mPrimaryTextColor = getColor(ta, 1, COLOR_INVALID);
                    mSecondaryTextColor = getColor(ta, 2, COLOR_INVALID);
                    mPrimaryAccentColor = getColor(ta, 3, COLOR_INVALID);
                    mSecondaryAccentColor = getColor(ta, 4, COLOR_INVALID);
                    mTertiaryAccentColor = getColor(ta, 5, COLOR_INVALID);
                    mOnAccentTextColor = getColor(ta, 6, COLOR_INVALID);
                    mErrorColor = getColor(ta, 7, COLOR_INVALID);
                    mRippleAlpha = Color.alpha(getColor(ta, 8, 0x33ffffff));
                }
                mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor,
                        mBackgroundColor, nightMode);
@@ -12889,9 +12886,7 @@ public class Notification implements Parcelable
                }
            }
            // make sure every color has a valid value
            if (mProtectionColor == COLOR_INVALID) {
                mProtectionColor = ColorUtils.blendARGB(mPrimaryTextColor, mBackgroundColor, 0.8f);
            }
            mProtectionColor = ColorUtils.blendARGB(mPrimaryTextColor, mBackgroundColor, 0.9f);
        }
        /** calculates the contrast color for the non-colorized notifications */