Added option to not shown unread in nav menu

This commit is contained in:
M66B
2025-02-13 10:40:09 +01:00
parent 5085ecf619
commit e0e3f5819d
6 changed files with 44 additions and 7 deletions

View File

@@ -97,6 +97,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swNavCategories;
private SwitchCompat swNavLastSync;
private SwitchCompat swNavMessageCount;
private SwitchCompat swNavUnseen;
private SwitchCompat swNavUnseenDrafts;
private SwitchCompat swNavPinnedCount;
private SwitchCompat swShowUnexposed;
@@ -218,7 +219,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"date", "date_week", "date_fixed", "date_bold", "date_time", "group_category",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers", "tabular_unread_bg",
"portrait2", "portrait2c", "landscape", "close_pane", "column_width",
"hide_toolbar", "edge_to_edge", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed",
"hide_toolbar", "edge_to_edge", "nav_options", "nav_categories", "nav_last_sync", "nav_count", "nav_unseen", "nav_unseen_drafts", "nav_count_pinned", "show_unexposed",
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_swap", "actionbar_color",
"highlight_unread", "highlight_color", "account_color", "color_stripe_wide",
"avatars", "bimi", "bimi_vmc", "gravatars", "libravatars", "favicons", "favicons_partial", "favicons_manifest", "ddg_icons", "favicons_dmarc", "generated_icons", "identicons",
@@ -280,6 +281,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swNavCategories = view.findViewById(R.id.swNavCategories);
swNavLastSync = view.findViewById(R.id.swNavLastSync);
swNavMessageCount = view.findViewById(R.id.swNavMessageCount);
swNavUnseen = view.findViewById(R.id.swNavUnseen);
swNavUnseenDrafts = view.findViewById(R.id.swNavUnseenDrafts);
swNavPinnedCount = view.findViewById(R.id.swNavPinnedCount);
swShowUnexposed = view.findViewById(R.id.swShowUnexposed);
@@ -682,6 +684,15 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swNavUnseen.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("nav_unseen", checked).apply();
swNavUnseenDrafts.setEnabled(checked);
swNavPinnedCount.setEnabled(checked);
}
});
swNavUnseenDrafts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -1624,8 +1635,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));
swNavLastSync.setChecked(prefs.getBoolean("nav_last_sync", true));
swNavMessageCount.setChecked(prefs.getBoolean("nav_count", false));
swNavUnseen.setChecked(prefs.getBoolean("nav_unseen", true));
swNavUnseenDrafts.setChecked(prefs.getBoolean("nav_unseen_drafts", false));
swNavUnseenDrafts.setEnabled(swNavUnseen.isChecked());
swNavPinnedCount.setChecked(prefs.getBoolean("nav_count_pinned", false));
swNavPinnedCount.setEnabled(swNavUnseen.isChecked());
swShowUnexposed.setChecked(prefs.getBoolean("show_unexposed", false));
swThreading.setChecked(prefs.getBoolean("threading", true));