From 3f98b9ee978ec06df0676e10ae167e201da05345 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 19 Jun 2020 21:45:14 +0200 Subject: [PATCH] Drafts with subject have content --- .../java/eu/faircode/email/FragmentCompose.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index da295e776b..3a6e320567 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2768,10 +2768,27 @@ public class FragmentCompose extends FragmentBase { } private boolean isEmpty() { + String subject = etSubject.getText().toString().trim(); + if (!TextUtils.isEmpty(subject)) { + boolean found = false; + List res = new ArrayList<>(); + res.addAll(Arrays.asList(Helper.getStrings(getContext(), R.string.title_subject_reply, ""))); + res.addAll(Arrays.asList(Helper.getStrings(getContext(), R.string.title_subject_forward, ""))); + for (String re : res) + if (subject.startsWith(re)) { + found = true; + break; + } + if (!found) + return false; + } + if (!TextUtils.isEmpty(JsoupEx.parse(HtmlHelper.toHtml(etBody.getText())).text().trim())) return false; + if (rvAttachment.getAdapter().getItemCount() > 0) return false; + return true; }