Added auto hide toolbar

This commit is contained in:
M66B
2023-01-07 11:26:19 +01:00
parent 0d395e54dc
commit de672d0c05
12 changed files with 121 additions and 11 deletions

View File

@@ -87,6 +87,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swClosePane;
private TextView tvColumnWidth;
private SeekBar sbColumnWidth;
private SwitchCompat swHideToolbar;
private SwitchCompat swNavOptions;
private SwitchCompat swNavCategories;
private SwitchCompat swNavMessageCount;
@@ -196,7 +197,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"date", "date_week", "date_fixed", "date_bold", "group_category",
"cards", "beige", "tabular_card_bg", "shadow_unread", "shadow_border", "shadow_highlight", "dividers",
"portrait2", "portrait2c", "landscape", "close_pane", "column_width",
"nav_options", "nav_categories", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
"hide_toolbar", "nav_options", "nav_categories", "nav_count", "nav_unseen_drafts", "nav_count_pinned", "navbar_colorize",
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_swap", "actionbar_color",
"highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide",
"avatars", "bimi", "gravatars", "libravatars", "favicons", "favicons_partial", "generated_icons", "identicons",
@@ -250,6 +251,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swClosePane = view.findViewById(R.id.swClosePane);
tvColumnWidth = view.findViewById(R.id.tvColumnWidth);
sbColumnWidth = view.findViewById(R.id.sbColumnWidth);
swHideToolbar = view.findViewById(R.id.swHideToolbar);
swNavOptions = view.findViewById(R.id.swNavOptions);
swNavCategories = view.findViewById(R.id.swNavCategories);
swNavMessageCount = view.findViewById(R.id.swNavMessageCount);
@@ -582,6 +584,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swHideToolbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("hide_toolbar", checked).apply();
}
});
swNavOptions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -1409,6 +1418,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));
sbColumnWidth.setProgress(column_width);
swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", true));
swNavOptions.setChecked(prefs.getBoolean("nav_options", true));
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));
swNavMessageCount.setChecked(prefs.getBoolean("nav_count", false));