Added option for grey background color unread messages / tabular view

This commit is contained in:
M66B
2024-02-20 19:13:36 +01:00
parent e8c9642f88
commit 4f8d78d387
5 changed files with 34 additions and 4 deletions

View File

@@ -262,6 +262,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean shadow_unread;
private boolean shadow_border;
private boolean shadow_highlight;
private boolean tabular_unread_bg;
private boolean threading;
private boolean threading_unread;
private boolean indentation;
@@ -2015,7 +2016,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int fg = (shadow_highlight ? colorUnreadHighlight : colorAccent);
color = ColorUtils.blendARGB(colorCardBackground, fg, 0.125f);
}
} else if (split)
} else if (!cards && tabular_unread_bg && message.unseen > 0)
color = ColorUtils.setAlphaComponent(colorSeparator, 127);
else if (split)
color = ColorUtils.setAlphaComponent(textColorHighlightInverse, 127);
else if (flags_background && flagged && !expanded)
color = ColorUtils.setAlphaComponent(mcolor, 127);
@@ -8038,6 +8041,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.shadow_unread = prefs.getBoolean("shadow_unread", false);
this.shadow_border = prefs.getBoolean("shadow_border", true);
this.shadow_highlight = prefs.getBoolean("shadow_highlight", false);
this.tabular_unread_bg = prefs.getBoolean("tabular_unread_bg", false);
this.threading = prefs.getBoolean("threading", true);
this.threading_unread = threading && prefs.getBoolean("threading_unread", false);
this.indentation = prefs.getBoolean("indentation", false);

View File

@@ -140,7 +140,7 @@ public class FragmentOptions extends FragmentBase {
"check_authentication", "check_tls", "check_reply_domain", "check_mx", "check_blocklist",
"send_pending",
"startup", "answer_single",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers", "tabular_unread_bg",
"portrait2", "portrait2c", "portrait_min_size", "landscape", "landscape_min_size",
"column_width",
"hide_toolbar", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",

View File

@@ -82,6 +82,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swShadowBorder;
private SwitchCompat swShadowHighlight;
private SwitchCompat swTabularDividers;
private SwitchCompat swTabularUnreadBg;
private SwitchCompat swPortrait2;
private SwitchCompat swPortrait2c;
private Spinner spPortraitMinSize;
@@ -210,7 +211,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static List<String> RESET_OPTIONS = Collections.unmodifiableList(Arrays.asList(
"theme", "startup",
"date", "date_week", "date_fixed", "date_bold", "date_time", "group_category",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers", "tabular_unread_bg",
"portrait2", "portrait2c", "landscape", "close_pane", "open_pane", "column_width",
"hide_toolbar", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_swap", "actionbar_color",
@@ -259,6 +260,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadowBorder = view.findViewById(R.id.swShadowBorder);
swShadowHighlight = view.findViewById(R.id.swShadowHighlight);
swTabularDividers = view.findViewById(R.id.swTabularDividers);
swTabularUnreadBg = view.findViewById(R.id.swTabularUnreadBg);
swPortrait2 = view.findViewById(R.id.swPortrait2);
swPortrait2c = view.findViewById(R.id.swPortrait2c);
spPortraitMinSize = view.findViewById(R.id.spPortraitMinSize);
@@ -492,6 +494,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadowBorder.setEnabled(swShadow.isEnabled() && checked);
swShadowHighlight.setEnabled(swShadow.isEnabled() && checked);
swTabularDividers.setEnabled(!checked);
swTabularUnreadBg.setEnabled(!checked);
swIndentation.setEnabled(checked);
}
});
@@ -541,6 +544,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swTabularUnreadBg.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("tabular_unread_bg", checked).apply();
}
});
swPortrait2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -1542,6 +1552,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadowHighlight.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
swTabularDividers.setChecked(prefs.getBoolean("dividers", true));
swTabularDividers.setEnabled(!swCards.isChecked());
swTabularUnreadBg.setChecked(prefs.getBoolean("tabular_unread_bg", false));
swTabularUnreadBg.setEnabled(!swCards.isChecked());
swPortrait2.setChecked(prefs.getBoolean("portrait2", false));
swPortrait2c.setChecked(prefs.getBoolean("portrait2c", false) && !swPortrait2.isChecked());
spPortraitMinSize.setSelection(prefs.getInt("portrait_min_size", 0));