From a1b2d4e6fd0ac20a1c01ca9e9ae40fec7d85e7ae Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 18 Nov 2019 10:39:32 +0100 Subject: [PATCH] Moved setting --- .../eu/faircode/email/AdapterMessage.java | 3 +- .../eu/faircode/email/FragmentOptions.java | 3 +- .../email/FragmentOptionsDisplay.java | 26 ++++++++--------- .../res/layout/fragment_options_display.xml | 28 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index d3f431ea3c..26cddedbe7 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3636,6 +3636,8 @@ public class AdapterMessage extends RecyclerView.Adapter= 0) font_size_sender = Helper.getTextSize(context, fz_sender); @@ -3644,7 +3646,6 @@ public class AdapterMessage extends RecyclerView.Adapter= 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); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index 7956c4d00f..8357fdd374 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -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", diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 1bc134073e..e82eaaff48 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -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"); diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index eee0666d54..f44ce65169 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -371,6 +371,18 @@ app:layout_constraintTop_toBottomOf="@id/swDistinguishContacts" app:switchPadding="12dp" /> + + + app:layout_constraintTop_toBottomOf="@id/swSubjectTop" /> - -