Moved setting

This commit is contained in:
M66B 2019-11-18 10:39:32 +01:00
parent ca1fc37678
commit a1b2d4e6fd
4 changed files with 30 additions and 30 deletions

View File

@ -3636,6 +3636,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.name_email = prefs.getBoolean("name_email", false);
this.distinguish_contacts = prefs.getBoolean("distinguish_contacts", false);
this.subject_top = prefs.getBoolean("subject_top", false);
int fz_sender = prefs.getInt("font_size_sender", -1);
if (fz_sender >= 0)
font_size_sender = Helper.getTextSize(context, fz_sender);
@ -3644,7 +3646,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (fz_subject >= 0)
font_size_subject = Helper.getTextSize(context, fz_subject);
this.subject_top = prefs.getBoolean("subject_top", false);
this.subject_italic = prefs.getBoolean("subject_italic", true);
this.subject_ellipsize = prefs.getString("subject_ellipsize", "middle");
this.flags = prefs.getBoolean("flags", true);

View File

@ -41,9 +41,8 @@ public class FragmentOptions extends FragmentBase {
"subscriptions",
"landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"font_size_sender", "font_size_subject",
"name_email", "distinguish_contacts", "authentication",
"subject_top", "subject_italic", "subject_ellipsize",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize",
"flags", "flags_background", "preview", "preview_italic", "preview_lines",
"addresses", "attachments_alt",
"contrast", "monospaced", "text_color",

View File

@ -69,9 +69,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swNameEmail;
private SwitchCompat swDistinguishContacts;
private SwitchCompat swAuthentication;
private SwitchCompat swSubjectTop;
private Spinner spFontSizeSender;
private Spinner spFontSizeSubject;
private SwitchCompat swSubjectTop;
private SwitchCompat swSubjectItalic;
private Spinner spSubjectEllipsize;
private SwitchCompat swFlags;
@ -94,8 +94,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"theme", "landscape", "startup", "cards", "indentation", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"name_email", "distinguish_contacts", "authentication",
"font_size_sender", "font_size_subject",
"subject_top", "subject_italic", "subject_ellipsize",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize",
"flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color",
"inline_images", "collapse_quotes", "seekbar", "actionbar",
@ -132,9 +131,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swNameEmail = view.findViewById(R.id.swNameEmail);
swDistinguishContacts = view.findViewById(R.id.swDistinguishContacts);
swAuthentication = view.findViewById(R.id.swAuthentication);
swSubjectTop = view.findViewById(R.id.swSubjectTop);
spFontSizeSender = view.findViewById(R.id.spFontSizeSender);
spFontSizeSubject = view.findViewById(R.id.spFontSizeSubject);
swSubjectTop = view.findViewById(R.id.swSubjectTop);
swSubjectItalic = view.findViewById(R.id.swSubjectItalic);
spSubjectEllipsize = view.findViewById(R.id.spSubjectEllipsize);
swFlags = view.findViewById(R.id.swFlags);
@ -337,6 +336,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swSubjectTop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subject_top", checked).apply();
WidgetUnified.update(getContext());
}
});
spFontSizeSender.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
@ -363,14 +370,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swSubjectTop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subject_top", checked).apply();
WidgetUnified.update(getContext());
}
});
swSubjectItalic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -580,6 +579,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
int[] fontSizeValues = getResources().getIntArray(R.array.fontSizeValues);
int font_size_sender = prefs.getInt("font_size_sender", -1);
@ -596,7 +597,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
break;
}
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));
String subject_ellipsize = prefs.getString("subject_ellipsize", "middle");

View File

@ -371,6 +371,18 @@
app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSubjectTop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_subject_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthentication"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvFontSizeSender"
android:layout_width="0dp"
@ -382,7 +394,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthentication" />
app:layout_constraintTop_toBottomOf="@id/swSubjectTop" />
<Spinner
android:id="@+id/spFontSizeSender"
@ -415,18 +427,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvFontSizeSubject" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSubjectTop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_subject_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spFontSizeSubject"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSubjectItalic"
android:layout_width="0dp"
@ -436,7 +436,7 @@
android:text="@string/title_advanced_subject_italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSubjectTop"
app:layout_constraintTop_toBottomOf="@id/spFontSizeSubject"
app:switchPadding="12dp" />
<TextView