Added option to display name or name/email address

This commit is contained in:
M66B
2019-02-08 08:27:17 +00:00
parent 79102e1ed9
commit 21b7313bf9
5 changed files with 51 additions and 7 deletions

View File

@@ -67,6 +67,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swThreading;
private SwitchCompat swAvatars;
private SwitchCompat swIdenticons;
private SwitchCompat swNameEmail;
private SwitchCompat swPreview;
private SwitchCompat swAddresses;
private SwitchCompat swHtml;
@@ -93,7 +94,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private Group grpNotification;
static String[] OPTIONS_RESTART = new String[]{
"unified", "date", "threading", "avatars", "identicons", "preview", "addresses", "autoimages", "actionbar",
"unified", "date", "threading", "avatars", "identicons", "name_email", "preview", "addresses", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext",
"debug"
};
@@ -101,7 +102,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private final static String[] ADVANCED_OPTIONS = new String[]{
"enabled", "updates",
"metered", "download",
"unified", "date", "threading", "avatars", "identicons", "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",
"light", "sound",
"debug",
@@ -130,6 +131,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swThreading = view.findViewById(R.id.swThreading);
swAvatars = view.findViewById(R.id.swAvatars);
swIdenticons = view.findViewById(R.id.swIdenticons);
swNameEmail = view.findViewById(R.id.swNameEmail);
swPreview = view.findViewById(R.id.swPreview);
swAddresses = view.findViewById(R.id.swAddresses);
swHtml = view.findViewById(R.id.swHtml);
@@ -258,6 +260,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
}
});
swNameEmail.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("name_email", checked).apply();
}
});
swPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -475,11 +484,14 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
break;
}
boolean compact = prefs.getBoolean("compact", false);
swUnified.setChecked(prefs.getBoolean("unified", true));
swDate.setChecked(prefs.getBoolean("date", true));
swThreading.setChecked(prefs.getBoolean("threading", true));
swAvatars.setChecked(prefs.getBoolean("avatars", true));
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
swNameEmail.setChecked(prefs.getBoolean("name_email", !compact));
swPreview.setChecked(prefs.getBoolean("preview", false));
swAddresses.setChecked(prefs.getBoolean("addresses", true));
swHtml.setChecked(prefs.getBoolean("autohtml", false));