Fix colors in importance and conversation priority preferences

This would have been simpler and faster, but the ChannelPanelActivity
was giving me a context where Material colors always inflated in light
theme even if the device was in dark theme, so I had to work around it.

On the plus side, whoever next needs to change these colors will find
them neatly organized in themes.xml!

Bug: 284380876
Test: manual
Change-Id: I2eee877fe44d307a96d60168d0317444ff002669
This commit is contained in:
Julia Tuttle
2023-06-09 13:30:25 -04:00
parent 42339b4e56
commit b23136041d
8 changed files with 80 additions and 37 deletions

View File

@@ -163,13 +163,13 @@ public class BubblePreference extends Preference implements View.OnClickListener
void setSelected(Context context, boolean selected) {
mView.setBackground(mContext.getDrawable(selected
? R.drawable.button_border_selected
: R.drawable.button_border_unselected));
? R.drawable.notification_importance_button_background_selected
: R.drawable.notification_importance_button_background_unselected));
mView.setSelected(selected);
int colorResId = selected
? com.android.internal.R.attr.materialColorOnSecondaryContainer
: com.android.internal.R.attr.materialColorOnSurfaceVariant;
? R.attr.notification_importance_button_foreground_color_selected
: R.attr.notification_importance_button_foreground_color_unselected;
ColorStateList stateList = Utils.getColorAttr(context, colorResId);
mImageView.setImageTintList(stateList);
mTextView.setTextColor(stateList);