From af2e4b86feffdc23e367a633b03027b85dfc0cd1 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 23 Aug 2021 12:43:40 +0200 Subject: [PATCH] Moved reply-to-all setting --- .../email/FragmentOptionsBehavior.java | 13 +--------- .../faircode/email/FragmentOptionsSend.java | 12 +++++++++- .../res/layout/fragment_options_behavior.xml | 11 --------- .../main/res/layout/fragment_options_send.xml | 24 ++++++++++++++++++- app/src/main/res/values/strings.xml | 1 + 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index 3ae6de9ad2..10d3d086f4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -91,7 +91,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe private SwitchCompat swAutoUnflag; private SwitchCompat swAutoImportant; private SwitchCompat swResetImportance; - private SwitchCompat swReplyAll; final static int MAX_SWIPE_SENSITIVITY = 10; final static int DEFAULT_SWIPE_SENSITIVITY = 7; @@ -104,8 +103,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe "autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple", "autoclose", "onclose", "autoclose_unseen", "undo_timeout", - "autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance", - "reply_all" + "autoread", "flag_snoozed", "autounflag", "auto_important", "reset_importance" }; @Override @@ -152,7 +150,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swAutoUnflag = view.findViewById(R.id.swAutoUnflag); swAutoImportant = view.findViewById(R.id.swAutoImportant); swResetImportance = view.findViewById(R.id.swResetImportance); - swReplyAll = view.findViewById(R.id.swReplyAll); setOptions(); @@ -448,13 +445,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe } }); - swReplyAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("reply_all", checked).apply(); - } - }); - // Initialize FragmentDialogTheme.setBackground(getContext(), view, false); @@ -559,7 +549,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swAutoUnflag.setChecked(prefs.getBoolean("autounflag", false)); swAutoImportant.setChecked(prefs.getBoolean("auto_important", false)); swResetImportance.setChecked(prefs.getBoolean("reset_importance", false)); - swReplyAll.setChecked(prefs.getBoolean("reply_all", false)); } public static class FragmentDialogSwipes extends FragmentDialogBase { diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index 8877ac80ab..cf5f892be1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -61,6 +61,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private SwitchCompat swPrefixOnce; private RadioGroup rgRe; private RadioGroup rgFwd; + private SwitchCompat swReplyAll; private SwitchCompat swSendReminders; private Spinner spSendDelayed; private SwitchCompat swSendPending; @@ -92,7 +93,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private final static String[] RESET_OPTIONS = new String[]{ "keyboard", "keyboard_no_fullscreen", "suggest_names", "suggest_sent", "suggested_received", "suggest_frequently", - "alt_re", "alt_fwd", + "alt_re", "alt_fwd", "reply_all", "send_reminders", "send_delayed", "send_pending", "compose_font", "prefix_once", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply", "signature_location", "signature_new", "signature_reply", "signature_forward", @@ -121,6 +122,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc swPrefixOnce = view.findViewById(R.id.swPrefixOnce); rgRe = view.findViewById(R.id.rgRe); rgFwd = view.findViewById(R.id.rgFwd); + swReplyAll = view.findViewById(R.id.swReplyAll); swSendReminders = view.findViewById(R.id.swSendReminders); spSendDelayed = view.findViewById(R.id.spSendDelayed); swSendPending = view.findViewById(R.id.swSendPending); @@ -242,6 +244,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + swReplyAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("reply_all", checked).apply(); + } + }); + swSendReminders.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -517,6 +526,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc rgRe.check(prefs.getBoolean("alt_re", false) ? R.id.rbRe2 : R.id.rbRe1); rgFwd.check(prefs.getBoolean("alt_fwd", false) ? R.id.rbFwd2 : R.id.rbFwd1); + swReplyAll.setChecked(prefs.getBoolean("reply_all", false)); swSendReminders.setChecked(prefs.getBoolean("send_reminders", true)); int send_delayed = prefs.getInt("send_delayed", 0); diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index 4a77d490d2..32c9ac4c1f 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -616,17 +616,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swAutoImportant" app:switchPadding="12dp" /> - - diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index 73252f04c6..0bc8b8f539 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -264,6 +264,28 @@ android:textAppearance="@style/TextAppearance.AppCompat.Small" /> + + + + If disabled, only email addresses will be used when selecting contacts In addition to contacts provided by Android. Contact data will be stored for newly sent or received messages only when enabled. Insert \'-- \' between the text and the signature + If disabled, long pressing the answer button will answer the sender Show a warning when the message text or the subject is empty or when an attachment might be missing The email server could still add the messages to the sent message folder