From 3d8dc8aaf93e5a4d25b3b8f1aa4632a8643083ab Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 12 Jun 2020 09:42:09 +0200 Subject: [PATCH] Added option to disable signature on replying --- .../java/eu/faircode/email/FragmentCompose.java | 4 ++++ .../eu/faircode/email/FragmentOptionsSend.java | 13 ++++++++++++- app/src/main/res/layout/fragment_options_send.xml | 14 +++++++++++++- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index c1b391d3f8..a496ab7eaf 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -3388,6 +3388,10 @@ public class FragmentCompose extends FragmentBase { } } + // Signature + if ("reply".equals(action) || "reply_all".equals(action)) + data.draft.signature = prefs.getBoolean("signature_reply", true); + // Reply header String s = args.getString("selected"); if (ref.content && diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index 1bdeae0b6e..72add5b655 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -55,6 +55,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private SwitchCompat swQuoteReply; private SwitchCompat swResizeReply; private Spinner spSignatureLocation; + private SwitchCompat swSignatureReply; private SwitchCompat swPlainOnly; private SwitchCompat swFormatFlowed; @@ -67,7 +68,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private final static String[] RESET_OPTIONS = new String[]{ "keyboard", "suggest_sent", "suggested_received", "suggest_frequently", "send_reminders", "send_delayed", - "prefix_once", "extended_reply", "quote_reply", "resize_reply", "signature_location", + "prefix_once", "extended_reply", "quote_reply", "resize_reply", "signature_location", "signature_reply", "plain_only", "format_flowed", "usenet_signature", "remove_signatures", "receipt_default", "receipt_type", "lookup_mx" }; @@ -95,6 +96,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc swQuoteReply = view.findViewById(R.id.swQuoteReply); swResizeReply = view.findViewById(R.id.swResizeReply); spSignatureLocation = view.findViewById(R.id.spSignatureLocation); + swSignatureReply = view.findViewById(R.id.swSignatureReply); swPlainOnly = view.findViewById(R.id.swPlainOnly); swFormatFlowed = view.findViewById(R.id.swFormatFlowed); @@ -208,6 +210,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + swSignatureReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("signature_reply", checked).apply(); + } + }); + swPlainOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -331,6 +340,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc int signature_location = prefs.getInt("signature_location", 1); spSignatureLocation.setSelection(signature_location); + swSignatureReply.setChecked(prefs.getBoolean("signature_reply", true)); + swPlainOnly.setChecked(prefs.getBoolean("plain_only", false)); swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false)); swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false)); diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index b4870418d1..d297d83f2e 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -236,6 +236,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvSignatureLocation" /> + + + app:layout_constraintTop_toBottomOf="@+id/swSignatureReply" /> Quote replied text Resize images in replied text Signature position - Add signature after quoted/forwarded message + Use signature when replying Send plain text only by default \'format flowed\' for plain text When requesting a receipt