Added option for large message action buttons

This commit is contained in:
M66B
2022-08-19 17:14:18 +02:00
parent 390d133cec
commit 85719aaa7c
4 changed files with 68 additions and 19 deletions

View File

@@ -152,6 +152,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private TextView tvPreviewLinesHint;
private SwitchCompat swAddresses;
private SwitchCompat swLargeButtons;
private TextView tvMessageZoom;
private SeekBar sbMessageZoom;
private SwitchCompat swOverviewMode;
@@ -203,7 +204,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines",
"addresses",
"addresses", "large_buttons",
"message_zoom", "overview_mode", "override_width",
"hyphenation", "display_font", "contrast", "monospaced_pre",
"text_separators",
@@ -311,6 +312,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
spPreviewLines = view.findViewById(R.id.spPreviewLines);
tvPreviewLinesHint = view.findViewById(R.id.tvPreviewLinesHint);
swAddresses = view.findViewById(R.id.swAddresses);
swLargeButtons = view.findViewById(R.id.swLargeButtons);
tvMessageZoom = view.findViewById(R.id.tvMessageZoom);
sbMessageZoom = view.findViewById(R.id.sbMessageZoom);
swOverviewMode = view.findViewById(R.id.swOverviewMode);
@@ -1068,6 +1070,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swLargeButtons.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("large_buttons", checked).apply();
}
});
sbMessageZoom.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
@@ -1479,6 +1488,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
spPreviewLines.setEnabled(swPreview.isChecked());
swAddresses.setChecked(prefs.getBoolean("addresses", false));
swLargeButtons.setChecked(prefs.getBoolean("large_buttons", false));
int message_zoom = prefs.getInt("message_zoom", 100);
tvMessageZoom.setText(getString(R.string.title_advanced_message_text_zoom2, NF.format(message_zoom)));