From 2c74e0208f0771bc97caf20af02bce6f79a28cbe Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 2 Oct 2019 22:05:04 +0200 Subject: [PATCH] Added empty message warning --- .../java/eu/faircode/email/FragmentCompose.java | 9 ++++++++- app/src/main/res/layout/dialog_send.xml | 17 ++++++++++++++--- app/src/main/res/values/strings.xml | 1 + 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 053990a2b0..ecd329ce39 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2860,6 +2860,9 @@ public class FragmentCompose extends FragmentBase { if (TextUtils.isEmpty(draft.subject)) args.putBoolean("remind_subject", true); + if (empty) + args.putBoolean("remind_text", true); + int attached = 0; for (EntityAttachment attachment : attachments) if (!attachment.available) @@ -2990,9 +2993,10 @@ public class FragmentCompose extends FragmentBase { } else if (action == R.id.action_check) { boolean dialog = args.getBundle("extras").getBoolean("dialog"); boolean remind_subject = args.getBoolean("remind_subject", false); + boolean remind_text = args.getBoolean("remind_text", false); boolean remind_attachment = args.getBoolean("remind_attachment", false); - if (dialog || remind_subject || remind_attachment) { + if (dialog || remind_subject || remind_text || remind_attachment) { setBusy(false); FragmentDialogSend fragment = new FragmentDialogSend(); @@ -3463,6 +3467,7 @@ public class FragmentCompose extends FragmentBase { Bundle args = getArguments(); boolean dialog = args.getBundle("extras").getBoolean("dialog"); 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()); @@ -3474,6 +3479,7 @@ public class FragmentCompose extends FragmentBase { final ViewGroup dview = (ViewGroup) LayoutInflater.from(getContext()).inflate(R.layout.dialog_send, null); final TextView tvRemindSubject = dview.findViewById(R.id.tvRemindSubject); + final TextView tvRemindText = dview.findViewById(R.id.tvRemindText); final TextView tvRemindAttachment = dview.findViewById(R.id.tvRemindAttachment); final TextView tvTo = dview.findViewById(R.id.tvTo); final TextView tvVia = dview.findViewById(R.id.tvVia); @@ -3488,6 +3494,7 @@ public class FragmentCompose extends FragmentBase { final TextView tvNotAgain = dview.findViewById(R.id.tvNotAgain); tvRemindSubject.setVisibility(remind_subject ? View.VISIBLE : View.GONE); + tvRemindText.setVisibility(remind_text ? View.VISIBLE : View.GONE); tvRemindAttachment.setVisibility(remind_attachment ? View.VISIBLE : View.GONE); tvTo.setText(null); tvVia.setText(null); diff --git a/app/src/main/res/layout/dialog_send.xml b/app/src/main/res/layout/dialog_send.xml index cbd90d19f3..f825197caf 100644 --- a/app/src/main/res/layout/dialog_send.xml +++ b/app/src/main/res/layout/dialog_send.xml @@ -23,23 +23,34 @@ android:id="@+id/tvRemindSubject" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="24dp" + android:layout_marginTop="12dp" android:text="@string/title_subject_reminder" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textColor="?attr/colorWarning" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvMessage" /> + + + app:layout_constraintTop_toBottomOf="@id/tvRemindText" /> Sender missing Recipient missing Subject is empty + Message is empty attached,attachment,attachments,included Did you intend to add an attachment? Not all attachments are downloaded