Added optional background color instead of flag color

This commit is contained in:
M66B
2019-09-27 11:33:07 +02:00
parent ff2a4201c2
commit 0e8860ae1e
6 changed files with 59 additions and 10 deletions

View File

@@ -59,6 +59,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swSubjectItalic;
private Spinner spSubjectEllipsize;
private SwitchCompat swFlags;
private SwitchCompat swFlagsBackground;
private SwitchCompat swPreview;
private SwitchCompat swPreviewItalic;
private SwitchCompat swAddresses;
@@ -77,7 +78,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"theme", "startup", "cards", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "name_email",
"authentication", "subject_top", "subject_italic", "subject_ellipsize",
"flags", "preview", "preview_italic", "addresses", "attachments_alt",
"flags", "flags_background", "preview", "preview_italic", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color",
"inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar",
};
@@ -108,6 +109,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swSubjectItalic = view.findViewById(R.id.swSubjectItalic);
spSubjectEllipsize = view.findViewById(R.id.spSubjectEllipsize);
swFlags = view.findViewById(R.id.swFlags);
swFlagsBackground = view.findViewById(R.id.swFlagsBackground);
swPreview = view.findViewById(R.id.swPreview);
swPreviewItalic = view.findViewById(R.id.swPreviewItalic);
swAddresses = view.findViewById(R.id.swAddresses);
@@ -257,6 +259,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swFlagsBackground.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("flags_background", checked).apply();
}
});
swPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -419,6 +428,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
swFlags.setChecked(prefs.getBoolean("flags", true));
swFlagsBackground.setChecked(prefs.getBoolean("flags_background", false));
swPreview.setChecked(prefs.getBoolean("preview", false));
swPreviewItalic.setChecked(prefs.getBoolean("preview_italic", true));
swPreviewItalic.setEnabled(swPreview.isChecked());