Added option to disable signature on replying

This commit is contained in:
M66B 2020-06-12 09:42:09 +02:00
parent 12b0d25f19
commit 3d8dc8aaf9
4 changed files with 30 additions and 3 deletions

View File

@ -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 &&

View File

@ -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));

View File

@ -236,6 +236,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSignatureLocation" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSignatureReply"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_signature_reply"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSignatureLocation"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionAdvanced"
android:layout_width="0dp"
@ -246,7 +258,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spSignatureLocation" />
app:layout_constraintTop_toBottomOf="@+id/swSignatureReply" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPlainOnly"

View File

@ -290,7 +290,7 @@
<string name="title_advanced_quote_reply">Quote replied text</string>
<string name="title_advanced_resize_reply">Resize images in replied text</string>
<string name="title_advanced_signature_location">Signature position</string>
<string name="title_advanced_signature_end">Add signature after quoted/forwarded message</string>
<string name="title_advanced_signature_reply">Use signature when replying</string>
<string name="title_advanced_plain_only">Send plain text only by default</string>
<string name="title_advanced_flow">\'format flowed\' for plain text</string>
<string name="title_advanced_receipt">When requesting a receipt</string>