mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-25 23:20:53 +01:00
Added option to display name or name/email address
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user