Added icon button to create rule

This commit is contained in:
M66B
2020-06-23 14:19:46 +02:00
parent 1e5105a41a
commit 52f1efc2e0
8 changed files with 86 additions and 6 deletions

View File

@@ -104,6 +104,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swAddresses;
private SwitchCompat swArchiveTrash;
private SwitchCompat swMove;
private SwitchCompat swRule;
private SwitchCompat swContrast;
private SwitchCompat swMonospaced;
@@ -126,7 +127,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "highlight_subject", "subject_ellipsize",
"keywords_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines",
"addresses", "button_archive_trash", "button_move",
"addresses", "button_archive_trash", "button_move", "button_rule",
"contrast", "monospaced", "text_color", "text_size", "text_align",
"inline_images", "collapse_quotes", "attachments_alt",
"parse_classes", "authentication"
@@ -190,6 +191,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swAddresses = view.findViewById(R.id.swAddresses);
swArchiveTrash = view.findViewById(R.id.swArchiveTrash);
swMove = view.findViewById(R.id.swMove);
swRule = view.findViewById(R.id.swRule);
swContrast = view.findViewById(R.id.swContrast);
swMonospaced = view.findViewById(R.id.swMonospaced);
swTextColor = view.findViewById(R.id.swTextColor);
@@ -596,6 +598,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swRule.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("button_rule", checked).apply();
}
});
swContrast.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -804,6 +813,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swAddresses.setChecked(prefs.getBoolean("addresses", false));
swArchiveTrash.setChecked(prefs.getBoolean("button_archive_trash", true));
swMove.setChecked(prefs.getBoolean("button_move", true));
swRule.setChecked(prefs.getBoolean("button_rule", true));
swContrast.setChecked(prefs.getBoolean("contrast", false));
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swTextColor.setChecked(prefs.getBoolean("text_color", true));