Added option to show text high contrast

This commit is contained in:
M66B
2019-07-09 08:09:20 +02:00
parent 9fada9c0e4
commit 11dc9b40af
5 changed files with 29 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swPreview;
private SwitchCompat swAddresses;
private SwitchCompat swAttachmentsAlt;
private SwitchCompat swContrast;
private SwitchCompat swMonospaced;
private SwitchCompat swInline;
private SwitchCompat swImages;
@@ -62,7 +63,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "date", "threading", "avatars", "identicons", "circular", "name_email", "subject_italic",
"flags", "preview", "addresses", "attachments_alt", "monospaced", "inline_images", "autoimages", "autocontent", "actionbar",
"flags", "preview", "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "autoimages", "autocontent", "actionbar",
};
@Override
@@ -88,6 +89,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swPreview = view.findViewById(R.id.swPreview);
swAddresses = view.findViewById(R.id.swAddresses);
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
swContrast = view.findViewById(R.id.swContrast);
swMonospaced = view.findViewById(R.id.swMonospaced);
swInline = view.findViewById(R.id.swInline);
swImages = view.findViewById(R.id.swImages);
@@ -200,6 +202,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swContrast.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("contrast", checked).apply();
}
});
swMonospaced.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -300,6 +309,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swPreview.setChecked(prefs.getBoolean("preview", false));
swAddresses.setChecked(prefs.getBoolean("addresses", false));
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
swContrast.setChecked(prefs.getBoolean("contrast", false));
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swInline.setChecked(prefs.getBoolean("inline_images", false));
swImages.setChecked(prefs.getBoolean("autoimages", false));