From 4d72f1771dd753d829282816878c7666ba225fc1 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 11 Sep 2019 22:00:21 +0200 Subject: [PATCH] Moved option --- .../eu/faircode/email/FragmentOptions.java | 2 +- .../email/FragmentOptionsBehavior.java | 12 +-------- .../email/FragmentOptionsDisplay.java | 13 +++++++++- .../res/layout/fragment_options_behavior.xml | 26 +------------------ .../res/layout/fragment_options_display.xml | 26 ++++++++++++++++++- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 41 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index c278110f49..de680f2575 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -40,7 +40,7 @@ public class FragmentOptions extends FragmentBase { static String[] OPTIONS_RESTART = new String[]{ "subscriptions", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", - "name_email", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", + "name_email", "authentication", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose", "experiments", "debug", diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index a7ce4c6cde..0f4abbbc79 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -52,12 +52,11 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe private SwitchCompat swAutoRead; private SwitchCompat swAutoMove; private SwitchCompat swDiscardDelete; - private SwitchCompat swAuthentication; private SwitchCompat swDisableTracking; private final static String[] RESET_OPTIONS = new String[]{ "pull", "autoscroll", "swipenav", "doubletap", "expand_read", "autoexpand", "autoclose", "onclose", - "collapse", "autoread", "automove", "discard_delete", "authentication", "disable_tracking" + "collapse", "autoread", "automove", "discard_delete", "disable_tracking" }; @Override @@ -82,7 +81,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swAutoRead = view.findViewById(R.id.swAutoRead); swAutoMove = view.findViewById(R.id.swAutoMove); swDiscardDelete = view.findViewById(R.id.swDiscardDelete); - swAuthentication = view.findViewById(R.id.swAuthentication); swDisableTracking = view.findViewById(R.id.swDisableTracking); setOptions(); @@ -186,13 +184,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe } }); - swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("authentication", checked).apply(); - } - }); - swDisableTracking.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -268,7 +259,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swAutoRead.setChecked(prefs.getBoolean("autoread", false)); swAutoMove.setChecked(!prefs.getBoolean("automove", false)); swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", false)); - swAuthentication.setChecked(prefs.getBoolean("authentication", true)); swDisableTracking.setChecked(prefs.getBoolean("disable_tracking", true)); } } diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index d8503a8fe6..d73aa5dec6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -54,6 +54,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swIdenticons; private SwitchCompat swCircular; private SwitchCompat swNameEmail; + private SwitchCompat swAuthentication; private SwitchCompat swSubjectTop; private SwitchCompat swSubjectItalic; private Spinner spSubjectEllipsize; @@ -73,7 +74,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private final static String[] RESET_OPTIONS = new String[]{ "theme", "startup", "cards", "date", "threading", "highlight_unread", - "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "subject_ellipsize", + "avatars", "generated_icons", "identicons", "circular", "name_email", + "authentication", "subject_top", "subject_italic", "subject_ellipsize", "flags", "preview", "preview_italic", "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "collapse_quotes", "autocontent", "seekbar", "actionbar", }; @@ -99,6 +101,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swIdenticons = view.findViewById(R.id.swIdenticons); swCircular = view.findViewById(R.id.swCircular); swNameEmail = view.findViewById(R.id.swNameEmail); + swAuthentication = view.findViewById(R.id.swAuthentication); swSubjectTop = view.findViewById(R.id.swSubjectTop); swSubjectItalic = view.findViewById(R.id.swSubjectItalic); spSubjectEllipsize = view.findViewById(R.id.spSubjectEllipsize); @@ -209,6 +212,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("authentication", checked).apply(); + } + }); + swSubjectTop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -385,6 +395,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swIdenticons.setEnabled(swGeneratedIcons.isChecked()); swCircular.setChecked(prefs.getBoolean("circular", true)); swNameEmail.setChecked(prefs.getBoolean("name_email", false)); + swAuthentication.setChecked(prefs.getBoolean("authentication", true)); swSubjectTop.setChecked(prefs.getBoolean("subject_top", false)); swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true)); diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index db20dc204d..f82d14da2b 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -202,30 +202,6 @@ app:layout_constraintTop_toBottomOf="@id/swAutoMove" app:switchPadding="12dp" /> - - - - diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 3c90d0c634..23cdd20351 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -181,6 +181,30 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swNameEmail" /> + + + + Show identicons Show round icons Show names and email addresses + Show a warning when the receiving server could not authenticate the message Show subject above sender Show subject in italics When needed, shorten the subject @@ -269,7 +270,6 @@ Automatically mark messages read on moving messages Confirm moving messages On discard draft permanently delete draft - Show a warning when the receiving server could not authenticate the message Automatically recognize and disable tracking images Show launcher icon with number of new messages