From 56cb882b38de7ecd8c5c1d6372af5b30902a4657 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Sat, 21 Nov 2020 00:09:51 +0000 Subject: [PATCH] Use theme color instead of fixed one Notifications don't have fixed background anymore, their colors are themed based on a dynamic system palette. Test: manual Bug: 173561906 Bug: 173561901 Change-Id: Id0a41e04fe3e27d2ae59ab5c61a174211278c4a7 --- .../notification/history/NotificationSbnAdapter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/notification/history/NotificationSbnAdapter.java b/src/com/android/settings/notification/history/NotificationSbnAdapter.java index 0eb14ba55e1..f836855c195 100644 --- a/src/com/android/settings/notification/history/NotificationSbnAdapter.java +++ b/src/com/android/settings/notification/history/NotificationSbnAdapter.java @@ -52,6 +52,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.internal.logging.UiEventLogger; import com.android.internal.util.ContrastColorUtil; import com.android.settings.R; +import com.android.settingslib.Utils; import java.util.ArrayList; import java.util.HashMap; @@ -79,8 +80,8 @@ public class NotificationSbnAdapter extends mPm = pm; mUserBadgeCache = new HashMap<>(); mValues = new ArrayList<>(); - mBackgroundColor = mContext.getColor( - com.android.internal.R.color.notification_material_background_color); + mBackgroundColor = Utils.getColorAttrDefaultColor(context, + android.R.attr.colorBackground); Configuration currentConfig = mContext.getResources().getConfiguration(); mInNightMode = (currentConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;