Added option to disable send reminders

pull/172/head
M66B 6 years ago
parent 6522f18110
commit 2fddb29006

@ -3734,11 +3734,14 @@ public class FragmentCompose extends FragmentBase {
boolean remind_subject = args.getBoolean("remind_subject", false);
boolean remind_text = args.getBoolean("remind_text", false);
boolean remind_attachment = args.getBoolean("remind_attachment", false);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean send_reminders = prefs.getBoolean("send_reminders", true);
int recipients = (draft.to == null ? 0 : draft.to.length) +
(draft.cc == null ? 0 : draft.cc.length) +
(draft.bcc == null ? 0 : draft.bcc.length);
if (dialog || remind_subject || remind_text || remind_attachment || recipients > RECIPIENTS_WARNING) {
if (dialog || (send_reminders &&
(remind_subject || remind_text || remind_attachment || recipients > RECIPIENTS_WARNING))) {
setBusy(false);
FragmentDialogSend fragment = new FragmentDialogSend();

@ -56,6 +56,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swResizeAttachments;
private Spinner spAutoResize;
private TextView tvAutoResize;
private SwitchCompat swSendReminders;
private SwitchCompat swReceipt;
private SwitchCompat swLookupMx;
private Spinner spSendDelayed;
@ -64,7 +65,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
"keyboard", "suggest_sent", "suggested_received",
"prefix_once", "extended_reply", "quote_reply",
"plain_only", "usenet_signature",
"resize_images", "resize_attachments", "receipt_default", "resize", "lookup_mx", "send_delayed"
"resize_images", "resize_attachments", "send_reminders", "receipt_default", "resize", "lookup_mx", "send_delayed"
};
@Override
@ -90,6 +91,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swResizeAttachments = view.findViewById(R.id.swResizeAttachments);
spAutoResize = view.findViewById(R.id.spAutoResize);
tvAutoResize = view.findViewById(R.id.tvAutoResize);
swSendReminders = view.findViewById(R.id.swSendReminders);
swReceipt = view.findViewById(R.id.swReceipt);
swLookupMx = view.findViewById(R.id.swLookupMx);
spSendDelayed = view.findViewById(R.id.spSendDelayed);
@ -201,6 +203,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
swSendReminders.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("send_reminders", checked).apply();
}
});
swLookupMx.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -289,6 +298,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
spAutoResize.setEnabled(swResizeImages.isChecked() || swResizeAttachments.isChecked());
swSendReminders.setChecked(prefs.getBoolean("send_reminders", true));
swReceipt.setChecked(prefs.getBoolean("receipt_default", false));
swLookupMx.setChecked(prefs.getBoolean("lookup_mx", false));

@ -195,6 +195,29 @@
app:layout_constraintStart_toEndOf="@id/spAutoResize"
app:layout_constraintTop_toTopOf="@id/spAutoResize" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSendReminders"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_send_reminders"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spAutoResize"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvSendReminders"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_send_reminders_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSendReminders" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReceipt"
android:layout_width="0dp"
@ -203,7 +226,7 @@
android:text="@string/title_identity_receipt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spAutoResize"
app:layout_constraintTop_toBottomOf="@id/tvSendReminders"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -269,6 +269,7 @@
<string name="title_advanced_resize_images">Automatically resize embedded images</string>
<string name="title_advanced_resize_attachments">Automatically resize image attachments</string>
<string name="title_advanced_resize_pixels">&lt; %1$d pixels</string>
<string name="title_advanced_send_reminders">Show reminders</string>
<string name="title_advanced_lookup_mx">Check recipient email addresses before sending</string>
<string name="title_advanced_send_delayed">Delay sending messages</string>
@ -412,6 +413,7 @@
<string name="title_advanced_suggest_local_hint">In addition to contacts provided by Android. Contact data will be stored for newly sent or received messages only when enabled.</string>
<string name="title_advanced_usenet_hint">Insert \'-- \' between the text and the signature</string>
<string name="title_advanced_send_reminders_hint">Show a warning when the message text or the subject is empty or when an attachment might be missing</string>
<string name="title_advanced_lookup_mx_hint">This will check if DNS MX records exist</string>
<string name="title_advanced_check_reply_hint">This will check if domain name of the sender and reply addresses are the same</string>

Loading…
Cancel
Save