Added option for grey background color unread messages / tabular view

pull/214/head
M66B 10 months ago
parent e8c9642f88
commit 4f8d78d387

@ -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);

@ -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",

@ -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));

@ -315,6 +315,19 @@
app:layout_constraintTop_toBottomOf="@id/swShadowHighlight"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTabularUnreadBg"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_tabular_unread_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swTabularDividers"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvPortrait"
android:layout_width="0dp"
@ -326,7 +339,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swTabularDividers" />
app:layout_constraintTop_toBottomOf="@id/swTabularUnreadBg" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPortrait2"

@ -580,6 +580,7 @@
<string name="title_advanced_cards_shadow_border">Show border</string>
<string name="title_advanced_cards_shadow_highlight">Use highlight color instead of accent color</string>
<string name="title_advanced_tabular_dividers">Use divider lines when using tabular style</string>
<string name="title_advanced_tabular_unread_bg">Use a gray background color for unread messages when using table style</string>
<string name="title_advanced_date_header">Group by date</string>
<string name="title_advanced_date_week">Group by week instead of day</string>
<string name="title_advanced_date_fixed">Show fixed date header at the top</string>

Loading…
Cancel
Save