mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Ensure notification icons have enough contrast with background.
This uses the same color calculations as the system, except that we use the extracted notification background instead of assuming it is white. Bug: 32410600 Change-Id: I7be8b9459ca38d01a6780758898541e69ec42576
This commit is contained in:
@@ -61,6 +61,7 @@ public class NotificationFooterLayout extends LinearLayout {
|
||||
|
||||
LinearLayout.LayoutParams mIconLayoutParams;
|
||||
private LinearLayout mIconRow;
|
||||
private int mBackgroundColor;
|
||||
private int mTextColor;
|
||||
|
||||
public NotificationFooterLayout(Context context) {
|
||||
@@ -90,7 +91,8 @@ public class NotificationFooterLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
public void applyColors(IconPalette iconPalette) {
|
||||
setBackgroundTintList(ColorStateList.valueOf(iconPalette.backgroundColor));
|
||||
mBackgroundColor = iconPalette.backgroundColor;
|
||||
setBackgroundTintList(ColorStateList.valueOf(mBackgroundColor));
|
||||
findViewById(R.id.divider).setBackgroundColor(iconPalette.secondaryColor);
|
||||
mTextColor = iconPalette.textColor;
|
||||
}
|
||||
@@ -130,7 +132,7 @@ public class NotificationFooterLayout extends LinearLayout {
|
||||
|
||||
private void addNotificationIconForInfo(NotificationInfo info, boolean fromOverflow) {
|
||||
View icon = new View(getContext());
|
||||
icon.setBackground(info.iconDrawable);
|
||||
icon.setBackground(info.getIconForBackground(getContext(), mBackgroundColor));
|
||||
icon.setOnClickListener(info);
|
||||
int addIndex = mIconRow.getChildCount();
|
||||
if (fromOverflow) {
|
||||
|
||||
Reference in New Issue
Block a user