Drafts with subject have content

This commit is contained in:
M66B 2020-06-19 21:45:14 +02:00
parent e242938e2c
commit 3f98b9ee97
1 changed files with 17 additions and 0 deletions

View File

@ -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<String> 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;
}