Added option to prefer contact names

This commit is contained in:
M66B
2020-02-09 11:37:16 +01:00
parent da1afe95b1
commit b62c9b4ab8
5 changed files with 31 additions and 5 deletions

View File

@@ -75,6 +75,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SeekBar sbBrightness;
private SeekBar sbThreshold;
private SwitchCompat swNameEmail;
private SwitchCompat swPreferContact;
private SwitchCompat swDistinguishContacts;
private SwitchCompat swAuthentication;
private SwitchCompat swSubjectTop;
@@ -102,7 +103,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"theme", "landscape", "landscape3", "startup", "cards", "indentation", "date", "threading", "highlight_unread", "color_stripe",
"avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"name_email", "distinguish_contacts", "authentication",
"name_email", "prefer_contact", "distinguish_contacts", "authentication",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", "keywords_header",
"flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color",
@@ -142,6 +143,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
sbBrightness = view.findViewById(R.id.sbBrightness);
sbThreshold = view.findViewById(R.id.sbThreshold);
swNameEmail = view.findViewById(R.id.swNameEmail);
swPreferContact = view.findViewById(R.id.swPreferContact);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swAuthentication = view.findViewById(R.id.swAuthentication);
swSubjectTop = view.findViewById(R.id.swSubjectTop);
@@ -367,6 +369,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swPreferContact.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("prefer_contact", checked).apply();
}
});
swDistinguishContacts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -632,6 +641,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
sbThreshold.setEnabled(swGeneratedIcons.isChecked());
swNameEmail.setChecked(prefs.getBoolean("name_email", false));
swPreferContact.setChecked(prefs.getBoolean("prefer_contact", false));
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true));