mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Added option to distinguish contacts
This commit is contained in:
parent
b278908ec6
commit
3483d61233
4 changed files with 27 additions and 3 deletions
|
@ -39,7 +39,8 @@ public class FragmentOptions extends FragmentBase {
|
|||
|
||||
static String[] OPTIONS_RESTART = new String[]{
|
||||
"subscriptions",
|
||||
"startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular",
|
||||
"startup", "cards", "date", "threading", "highlight_unread", "distinguish_contacts",
|
||||
"avatars", "generated_icons", "identicons", "circular",
|
||||
"name_email", "authentication", "subject_top", "subject_italic", "subject_ellipsize",
|
||||
"flags", "flags_background", "preview", "preview_italic",
|
||||
"addresses", "attachments_alt",
|
||||
|
|
|
@ -49,6 +49,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
private SwitchCompat swDate;
|
||||
private SwitchCompat swThreading;
|
||||
private SwitchCompat swHighlightUnread;
|
||||
private SwitchCompat swDistinguishContacts;
|
||||
private SwitchCompat swAvatars;
|
||||
private SwitchCompat swGeneratedIcons;
|
||||
private SwitchCompat swIdenticons;
|
||||
|
@ -75,7 +76,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
private SwitchCompat swActionbar;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"theme", "startup", "cards", "date", "threading", "highlight_unread",
|
||||
"theme", "startup", "cards", "date", "threading", "highlight_unread", "distinguish_contacts",
|
||||
"avatars", "generated_icons", "identicons", "circular", "name_email",
|
||||
"authentication", "subject_top", "subject_italic", "subject_ellipsize",
|
||||
"flags", "flags_background", "preview", "preview_italic", "addresses", "attachments_alt",
|
||||
|
@ -99,6 +100,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
swDate = view.findViewById(R.id.swDate);
|
||||
swThreading = view.findViewById(R.id.swThreading);
|
||||
swHighlightUnread = view.findViewById(R.id.swHighlightUnread);
|
||||
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
|
||||
swAvatars = view.findViewById(R.id.swAvatars);
|
||||
swGeneratedIcons = view.findViewById(R.id.swGeneratedIcons);
|
||||
swIdenticons = view.findViewById(R.id.swIdenticons);
|
||||
|
@ -178,6 +180,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
}
|
||||
});
|
||||
|
||||
swDistinguishContacts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("distinguish_contacts", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAvatars.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
@ -411,6 +420,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
swDate.setChecked(prefs.getBoolean("date", true));
|
||||
swThreading.setChecked(prefs.getBoolean("threading", true));
|
||||
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", false));
|
||||
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
|
||||
swAvatars.setChecked(prefs.getBoolean("avatars", true));
|
||||
swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true));
|
||||
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
|
||||
|
|
|
@ -116,6 +116,18 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/tvThreadingHint"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swDistinguishContacts"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:checked="true"
|
||||
android:text="@string/title_advanced_distinguish_contacts"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swHighlightUnread"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swAvatars"
|
||||
android:layout_width="0dp"
|
||||
|
@ -125,7 +137,7 @@
|
|||
android:text="@string/title_advanced_avatars"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swHighlightUnread"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
|
|
@ -243,6 +243,7 @@
|
|||
<string name="title_advanced_date_header">Group by date</string>
|
||||
<string name="title_advanced_threading">Conversation threading</string>
|
||||
<string name="title_advanced_highlight_unread">Highlight unread messages</string>
|
||||
<string name="title_advanced_distinguish_contacts">Distinguish messages of known and unknown contacts</string>
|
||||
<string name="title_advanced_avatars">Show contact photos</string>
|
||||
<string name="title_advanced_generated_icons">Show generated icons</string>
|
||||
<string name="title_advanced_identicons">Show identicons</string>
|
||||
|
|
Loading…
Reference in a new issue