Added option to prefix subject only once

This commit is contained in:
M66B
2019-04-17 16:35:04 +02:00
parent aba949912c
commit e02c206499
4 changed files with 44 additions and 11 deletions

View File

@@ -98,6 +98,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private Spinner spAutoResize;
private TextView tvAutoResize;
private SwitchCompat swSender;
private SwitchCompat swPrefixOnce;
private SwitchCompat swAutoSend;
private SwitchCompat swBadge;
@@ -128,7 +129,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
"autoresize", "sender", "autosend",
"autoresize", "sender", "prefix_once", "autosend",
"notify_preview", "search_local", "light", "sound",
"authentication", "paranoid", "english", "updates", "debug",
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
@@ -180,6 +181,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
spAutoResize = view.findViewById(R.id.spAutoResize);
tvAutoResize = view.findViewById(R.id.tvAutoResize);
swSender = view.findViewById(R.id.swSender);
swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
swAutoSend = view.findViewById(R.id.swAutoSend);
swBadge = view.findViewById(R.id.swBadge);
@@ -502,6 +504,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
}
});
swPrefixOnce.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("prefix_once", checked).apply();
}
});
swAutoSend.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -681,6 +690,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
spAutoResize.setEnabled(swAutoResize.isChecked());
swSender.setChecked(prefs.getBoolean("sender", false));
swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", false));
swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
swBadge.setChecked(prefs.getBoolean("badge", true));