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

Commit 3beee7ca authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge "Add redundant tint to notification and footer button backgrounds." into...

Merge "Add redundant tint to notification and footer button backgrounds." into udc-dev am: 43439de6 am: 028a5466

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



Change-Id: Idc65348ba8c4fafed9f4eb9008bf382d0e77b4e0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ffc582a8 028a5466
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -321,7 +321,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    protected void setBackgroundTintColor(int color) {
    protected void setBackgroundTintColor(int color) {
        if (color != mCurrentBackgroundTint) {
        if (color != mCurrentBackgroundTint) {
            mCurrentBackgroundTint = color;
            mCurrentBackgroundTint = color;
            if (color == mNormalColor) {
            // TODO(282173943): re-enable this tinting optimization when Resources are thread-safe
            if (false && color == mNormalColor) {
                // We don't need to tint a normal notification
                // We don't need to tint a normal notification
                color = 0;
                color = 0;
            }
            }
+17 −3
Original line number Original line Diff line number Diff line
@@ -16,11 +16,15 @@


package com.android.systemui.statusbar.notification.row;
package com.android.systemui.statusbar.notification.row;


import static android.graphics.PorterDuff.Mode.SRC_ATOP;

import android.annotation.ColorInt;
import android.annotation.ColorInt;
import android.content.Context;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources;
import android.graphics.ColorFilter;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.IndentingPrintWriter;
import android.util.IndentingPrintWriter;
@@ -157,10 +161,20 @@ public class FooterView extends StackScrollerDecorView {
     */
     */
    public void updateColors() {
    public void updateColors() {
        Resources.Theme theme = mContext.getTheme();
        Resources.Theme theme = mContext.getTheme();
        int textColor = getResources().getColor(R.color.notif_pill_text, theme);
        final @ColorInt int textColor = getResources().getColor(R.color.notif_pill_text, theme);
        mClearAllButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background));
        final Drawable clearAllBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
        final Drawable manageBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
        // TODO(b/282173943): Remove redundant tinting once Resources are thread-safe
        final @ColorInt int buttonBgColor =
                Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface);
        final ColorFilter bgColorFilter = new PorterDuffColorFilter(buttonBgColor, SRC_ATOP);
        if (buttonBgColor != 0) {
            clearAllBg.setColorFilter(bgColorFilter);
            manageBg.setColorFilter(bgColorFilter);
        }
        mClearAllButton.setBackground(clearAllBg);
        mClearAllButton.setTextColor(textColor);
        mClearAllButton.setTextColor(textColor);
        mManageButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background));
        mManageButton.setBackground(manageBg);
        mManageButton.setTextColor(textColor);
        mManageButton.setTextColor(textColor);
        final @ColorInt int labelTextColor =
        final @ColorInt int labelTextColor =
                Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);
                Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);