Added option to start with two rows or two columns

This commit is contained in:
M66B
2023-05-18 22:33:16 +02:00
parent 6364783edf
commit 91ff972296
4 changed files with 32 additions and 4 deletions

View File

@@ -85,6 +85,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swLandscape;
private Spinner spLandscapeMinSize;
private SwitchCompat swClosePane;
private SwitchCompat swOpenPane;
private TextView tvColumnWidth;
private SeekBar sbColumnWidth;
private SwitchCompat swHideToolbar;
@@ -199,7 +200,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"theme", "startup",
"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",
"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",
"highlight_unread", "highlight_color", "color_stripe", "color_stripe_wide",
@@ -252,6 +253,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swLandscape = view.findViewById(R.id.swLandscape);
spLandscapeMinSize = view.findViewById(R.id.spLandscapeMinSize);
swClosePane = view.findViewById(R.id.swClosePane);
swOpenPane = view.findViewById(R.id.swOpenPane);
tvColumnWidth = view.findViewById(R.id.tvColumnWidth);
sbColumnWidth = view.findViewById(R.id.sbColumnWidth);
swHideToolbar = view.findViewById(R.id.swHideToolbar);
@@ -565,6 +567,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("close_pane", checked).apply();
swOpenPane.setEnabled(!checked);
}
});
swOpenPane.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("open_pane", checked).apply();
}
});
@@ -1435,6 +1445,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swLandscape.setChecked(prefs.getBoolean("landscape", true));
spLandscapeMinSize.setSelection(prefs.getInt("landscape_min_size", 0));
swClosePane.setChecked(prefs.getBoolean("close_pane", !Helper.isSurfaceDuo()));
swOpenPane.setChecked(prefs.getBoolean("open_pane", false));
swOpenPane.setEnabled(!swClosePane.isChecked());
int column_width = prefs.getInt("column_width", 67);
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));