Added option to enable inverting original message

This commit is contained in:
M66B
2019-04-20 16:00:46 +02:00
parent 4c974be407
commit 4ac61a7d34
6 changed files with 41 additions and 12 deletions

View File

@@ -86,6 +86,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swMonospaced;
private SwitchCompat swHtml;
private SwitchCompat swImages;
private SwitchCompat swInvert;
private SwitchCompat swActionbar;
private SwitchCompat swPull;
@@ -120,7 +121,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
static String[] OPTIONS_RESTART = new String[]{
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
"addresses", "monospaced", "autohtml", "autoimages", "invert", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext",
"authentication", "debug"
};
@@ -129,7 +130,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"enabled", "schedule_start", "schedule_end",
"metered", "download", "roaming",
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
"addresses", "monospaced", "autohtml", "autoimages", "invert", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
"autoresize", "resize", "prefix_once", "autosend",
"notify_preview", "search_local", "light", "sound",
@@ -171,6 +172,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swMonospaced = view.findViewById(R.id.swMonospaced);
swHtml = view.findViewById(R.id.swHtml);
swImages = view.findViewById(R.id.swImages);
swInvert = view.findViewById(R.id.swInvert);
swActionbar = view.findViewById(R.id.swActionbar);
swPull = view.findViewById(R.id.swPull);
@@ -390,6 +392,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
}
});
swInvert.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("invert", checked).apply();
}
});
swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -686,6 +695,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swHtml.setChecked(prefs.getBoolean("autohtml", false));
swImages.setChecked(prefs.getBoolean("autoimages", false));
swInvert.setChecked(prefs.getBoolean("invert", false));
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
swPull.setChecked(prefs.getBoolean("pull", true));