Added option to start with two rows or two columns

pull/212/head
M66B 1 year ago
parent 6364783edf
commit 91ff972296

@ -245,6 +245,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
" portrait rows=" + portrait2 + " cols=" + portrait2c + " min=" + portrait_min_size +
" landscape cols=" + landscape + " min=" + landscape);
boolean duo = Helper.isSurfaceDuo();
boolean close_pane = prefs.getBoolean("close_pane", !duo);
boolean open_pane = (!close_pane && prefs.getBoolean("open_pane", false));
boolean nav_categories = prefs.getBoolean("nav_categories", false);
// 1=small, 2=normal, 3=large, 4=xlarge
@ -708,8 +710,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
// Initialize
if (content_pane != null) {
content_separator.setVisibility(duo ? View.INVISIBLE : View.GONE);
content_pane.setVisibility(duo ? View.INVISIBLE : View.GONE);
content_separator.setVisibility(duo || open_pane ? View.INVISIBLE : View.GONE);
content_pane.setVisibility(duo || open_pane ? View.INVISIBLE : View.GONE);
}
if (getSupportFragmentManager().getFragments().size() == 0 &&

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

@ -494,6 +494,19 @@
app:layout_constraintTop_toBottomOf="@id/tvLandscapeSplitMinHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swOpenPane"
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_open_pane"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swClosePane"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvColumnWidth"
android:layout_width="0dp"
@ -504,7 +517,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swClosePane" />
app:layout_constraintTop_toBottomOf="@id/swOpenPane" />
<SeekBar
android:id="@+id/sbColumnWidth"

@ -525,6 +525,7 @@
<string name="title_advanced_two_col">Use two columns</string>
<string name="title_advanced_min_screen_size">Minimum screen size for splitting the screen</string>
<string name="title_advanced_close_pane">Collapse row or column when closing a conversation</string>
<string name="title_advanced_open_pane">Start with two rows or two columns</string>
<string name="title_advanced_column_width">Message column width / row height: %1$s %%</string>
<string name="title_advanced_hide_toolbar">Hide top toolbar when scrolling messages</string>
<string name="title_advanced_nav_options">Show navigation menu options</string>

Loading…
Cancel
Save