Moved setting

pull/162/head
M66B 6 years ago
parent 5853d73bc7
commit 20d0760675

@ -191,8 +191,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean date; private boolean date;
private boolean threading; private boolean threading;
private boolean distinguish_contacts;
private boolean name_email; private boolean name_email;
private boolean distinguish_contacts;
private boolean subject_top; private boolean subject_top;
private boolean subject_italic; private boolean subject_italic;
private String subject_ellipsize; private String subject_ellipsize;
@ -3295,8 +3295,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.date = prefs.getBoolean("date", true); this.date = prefs.getBoolean("date", true);
this.threading = prefs.getBoolean("threading", true); this.threading = prefs.getBoolean("threading", true);
this.distinguish_contacts = prefs.getBoolean("distinguish_contacts", false);
this.name_email = prefs.getBoolean("name_email", false); this.name_email = prefs.getBoolean("name_email", false);
this.distinguish_contacts = prefs.getBoolean("distinguish_contacts", false);
this.subject_top = prefs.getBoolean("subject_top", false); this.subject_top = prefs.getBoolean("subject_top", false);
this.subject_italic = prefs.getBoolean("subject_italic", true); this.subject_italic = prefs.getBoolean("subject_italic", true);
this.subject_ellipsize = prefs.getString("subject_ellipsize", "middle"); this.subject_ellipsize = prefs.getString("subject_ellipsize", "middle");

@ -39,9 +39,10 @@ public class FragmentOptions extends FragmentBase {
static String[] OPTIONS_RESTART = new String[]{ static String[] OPTIONS_RESTART = new String[]{
"subscriptions", "subscriptions",
"startup", "cards", "date", "threading", "highlight_unread", "distinguish_contacts", "startup", "cards", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "avatars", "generated_icons", "identicons", "circular",
"name_email", "authentication", "subject_top", "subject_italic", "subject_ellipsize", "name_email", "distinguish_contacts", "authentication",
"subject_top", "subject_italic", "subject_ellipsize",
"flags", "flags_background", "preview", "preview_italic", "flags", "flags_background", "preview", "preview_italic",
"addresses", "attachments_alt", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color", "contrast", "monospaced", "text_color",

@ -49,12 +49,12 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swDate; private SwitchCompat swDate;
private SwitchCompat swThreading; private SwitchCompat swThreading;
private SwitchCompat swHighlightUnread; private SwitchCompat swHighlightUnread;
private SwitchCompat swDistinguishContacts;
private SwitchCompat swAvatars; private SwitchCompat swAvatars;
private SwitchCompat swGeneratedIcons; private SwitchCompat swGeneratedIcons;
private SwitchCompat swIdenticons; private SwitchCompat swIdenticons;
private SwitchCompat swCircular; private SwitchCompat swCircular;
private SwitchCompat swNameEmail; private SwitchCompat swNameEmail;
private SwitchCompat swDistinguishContacts;
private SwitchCompat swAuthentication; private SwitchCompat swAuthentication;
private SwitchCompat swSubjectTop; private SwitchCompat swSubjectTop;
private SwitchCompat swSubjectItalic; private SwitchCompat swSubjectItalic;
@ -76,9 +76,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swActionbar; private SwitchCompat swActionbar;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "cards", "date", "threading", "highlight_unread", "distinguish_contacts", "theme", "startup", "cards", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "name_email", "avatars", "generated_icons", "identicons", "circular", "name_email", "distinguish_contacts", "authentication",
"authentication", "subject_top", "subject_italic", "subject_ellipsize", "subject_top", "subject_italic", "subject_ellipsize",
"flags", "flags_background", "preview", "preview_italic", "addresses", "attachments_alt", "flags", "flags_background", "preview", "preview_italic", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color", "contrast", "monospaced", "text_color",
"inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar", "inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar",
@ -100,12 +100,12 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDate = view.findViewById(R.id.swDate); swDate = view.findViewById(R.id.swDate);
swThreading = view.findViewById(R.id.swThreading); swThreading = view.findViewById(R.id.swThreading);
swHighlightUnread = view.findViewById(R.id.swHighlightUnread); swHighlightUnread = view.findViewById(R.id.swHighlightUnread);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swAvatars = view.findViewById(R.id.swAvatars); swAvatars = view.findViewById(R.id.swAvatars);
swGeneratedIcons = view.findViewById(R.id.swGeneratedIcons); swGeneratedIcons = view.findViewById(R.id.swGeneratedIcons);
swIdenticons = view.findViewById(R.id.swIdenticons); swIdenticons = view.findViewById(R.id.swIdenticons);
swCircular = view.findViewById(R.id.swCircular); swCircular = view.findViewById(R.id.swCircular);
swNameEmail = view.findViewById(R.id.swNameEmail); swNameEmail = view.findViewById(R.id.swNameEmail);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swAuthentication = view.findViewById(R.id.swAuthentication); swAuthentication = view.findViewById(R.id.swAuthentication);
swSubjectTop = view.findViewById(R.id.swSubjectTop); swSubjectTop = view.findViewById(R.id.swSubjectTop);
swSubjectItalic = view.findViewById(R.id.swSubjectItalic); swSubjectItalic = view.findViewById(R.id.swSubjectItalic);
@ -180,13 +180,6 @@ 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() { swAvatars.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -227,6 +220,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();
}
});
swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -420,13 +420,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDate.setChecked(prefs.getBoolean("date", true)); swDate.setChecked(prefs.getBoolean("date", true));
swThreading.setChecked(prefs.getBoolean("threading", true)); swThreading.setChecked(prefs.getBoolean("threading", true));
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", false)); swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", false));
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swAvatars.setChecked(prefs.getBoolean("avatars", true)); swAvatars.setChecked(prefs.getBoolean("avatars", true));
swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true)); swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true));
swIdenticons.setChecked(prefs.getBoolean("identicons", false)); swIdenticons.setChecked(prefs.getBoolean("identicons", false));
swIdenticons.setEnabled(swGeneratedIcons.isChecked()); swIdenticons.setEnabled(swGeneratedIcons.isChecked());
swCircular.setChecked(prefs.getBoolean("circular", true)); swCircular.setChecked(prefs.getBoolean("circular", true));
swNameEmail.setChecked(prefs.getBoolean("name_email", false)); swNameEmail.setChecked(prefs.getBoolean("name_email", false));
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true)); swAuthentication.setChecked(prefs.getBoolean("authentication", true));
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false)); swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true)); swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));

@ -128,18 +128,6 @@
app:layout_constraintTop_toBottomOf="@id/tvThreadingHint" app:layout_constraintTop_toBottomOf="@id/tvThreadingHint"
app:switchPadding="12dp" /> 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 <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAvatars" android:id="@+id/swAvatars"
android:layout_width="0dp" android:layout_width="0dp"
@ -149,7 +137,7 @@
android:text="@string/title_advanced_avatars" android:text="@string/title_advanced_avatars"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts" app:layout_constraintTop_toBottomOf="@id/swHighlightUnread"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
@ -210,6 +198,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNameEmail" /> app:layout_constraintTop_toBottomOf="@id/swNameEmail" />
<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/tvNameEmailHint"
app:switchPadding="12dp" />
<ImageView <ImageView
android:id="@+id/ivAuth" android:id="@+id/ivAuth"
android:layout_width="21dp" android:layout_width="21dp"
@ -231,7 +231,7 @@
android:text="@string/title_advanced_authentication" android:text="@string/title_advanced_authentication"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivAuth" app:layout_constraintStart_toEndOf="@id/ivAuth"
app:layout_constraintTop_toBottomOf="@id/tvNameEmailHint" app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

Loading…
Cancel
Save