Refactoring

pull/147/head
M66B 6 years ago
parent 2f69c2b63a
commit c9308e71ff

@ -82,8 +82,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swCollapse; private SwitchCompat swCollapse;
private SwitchCompat swAutoRead; private SwitchCompat swAutoRead;
private SwitchCompat swAutoMove; private SwitchCompat swAutoMove;
private SwitchCompat swSender;
private SwitchCompat swAutoResize; private SwitchCompat swAutoResize;
private SwitchCompat swSender;
private SwitchCompat swAutoSend; private SwitchCompat swAutoSend;
private SwitchCompat swNotifyPreview; private SwitchCompat swNotifyPreview;
@ -104,11 +104,12 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"enabled", "updates", "enabled", "updates",
"metered", "download", "metered", "download",
"unified", "date", "threading", "avatars", "identicons", "name_email", "preview", "addresses", "autoimages", "actionbar", "unified", "date", "threading", "avatars", "identicons", "name_email", "preview", "addresses", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove", "sender", "autoresize", "autosend", "pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
"autoresize", "sender", "autosend",
"notify_preview", "light", "sound", "notify_preview", "light", "sound",
"debug", "debug",
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync", "first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
"edit_ref_confirmed", "autosend", "automove", "show_html_confirmed", "show_images_confirmed" "edit_ref_confirmed", "show_html_confirmed", "show_images_confirmed"
}; };
@Override @Override
@ -147,8 +148,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swCollapse = view.findViewById(R.id.swCollapse); swCollapse = view.findViewById(R.id.swCollapse);
swAutoRead = view.findViewById(R.id.swAutoRead); swAutoRead = view.findViewById(R.id.swAutoRead);
swAutoMove = view.findViewById(R.id.swAutoMove); swAutoMove = view.findViewById(R.id.swAutoMove);
swSender = view.findViewById(R.id.swSender);
swAutoResize = view.findViewById(R.id.swAutoResize); swAutoResize = view.findViewById(R.id.swAutoResize);
swSender = view.findViewById(R.id.swSender);
swAutoSend = view.findViewById(R.id.swAutoSend); swAutoSend = view.findViewById(R.id.swAutoSend);
swNotifyPreview = view.findViewById(R.id.swNotifyPreview); swNotifyPreview = view.findViewById(R.id.swNotifyPreview);
@ -362,17 +363,17 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
} }
}); });
swSender.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swAutoResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sender", checked).apply(); prefs.edit().putBoolean("autoresize", checked).apply();
} }
}); });
swAutoResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swSender.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autoresize", checked).apply(); prefs.edit().putBoolean("sender", checked).apply();
} }
}); });
@ -517,8 +518,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swCollapse.setChecked(prefs.getBoolean("collapse", false)); swCollapse.setChecked(prefs.getBoolean("collapse", false));
swAutoRead.setChecked(prefs.getBoolean("autoread", false)); swAutoRead.setChecked(prefs.getBoolean("autoread", false));
swAutoMove.setChecked(!prefs.getBoolean("automove", false)); swAutoMove.setChecked(!prefs.getBoolean("automove", false));
swSender.setChecked(prefs.getBoolean("sender", false));
swAutoResize.setChecked(prefs.getBoolean("autoresize", true)); swAutoResize.setChecked(prefs.getBoolean("autoresize", true));
swSender.setChecked(prefs.getBoolean("sender", false));
swAutoSend.setChecked(!prefs.getBoolean("autosend", false)); swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
swNotifyPreview.setChecked(prefs.getBoolean("notify_preview", true)); swNotifyPreview.setChecked(prefs.getBoolean("notify_preview", true));

@ -171,8 +171,8 @@
<string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string> <string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string>
<string name="title_advanced_automove">Confirm moving messages</string> <string name="title_advanced_automove">Confirm moving messages</string>
<string name="title_advanced_confirm">Confirm actions that might leak privacy sensitive information</string> <string name="title_advanced_confirm">Confirm actions that might leak privacy sensitive information</string>
<string name="title_advanced_sender">Allow editing sender address</string>
<string name="title_advanced_autoresize">Automatically resize images for displaying on screens</string> <string name="title_advanced_autoresize">Automatically resize images for displaying on screens</string>
<string name="title_advanced_sender">Allow editing sender address</string>
<string name="title_advanced_autosend">Confirm sending messages</string> <string name="title_advanced_autosend">Confirm sending messages</string>
<string name="title_advanced_updates">Check for updates</string> <string name="title_advanced_updates">Check for updates</string>

Loading…
Cancel
Save