1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 10:47:28 +00:00

Small improvement

This commit is contained in:
M66B 2019-11-08 18:07:53 +01:00
parent 6cf2fae5fb
commit e40372a9ed

View file

@ -755,7 +755,7 @@ public class FragmentCompose extends FragmentBase {
args.putBoolean("plain", plain);
args.putString("body", HtmlHelper.toHtml(etBody.getText()));
new SimpleTask<Spanned>() {
new SimpleTask<String>() {
@Override
protected void onPreExecute(Bundle args) {
ibReferenceDelete.setEnabled(false);
@ -769,7 +769,7 @@ public class FragmentCompose extends FragmentBase {
}
@Override
protected Spanned onExecute(Context context, Bundle args) throws Throwable {
protected String onExecute(Context context, Bundle args) throws Throwable {
long id = args.getLong("id");
boolean plain = args.getBoolean("plain");
String body = args.getString("body");
@ -784,13 +784,13 @@ public class FragmentCompose extends FragmentBase {
html = HtmlHelper.sanitize(context, ref, true);
refFile.delete();
return HtmlHelper.fromHtml(body + html);
return body + html;
}
@Override
protected void onExecuted(Bundle args, Spanned body) {
etBody.setText(body);
protected void onExecuted(Bundle args, String html) {
Bundle extras = new Bundle();
extras.putString("html", html);
extras.putBoolean("show", true);
onAction(R.id.action_save, extras);
}
@ -1959,7 +1959,11 @@ public class FragmentCompose extends FragmentBase {
args.putString("cc", etCc.getText().toString().trim());
args.putString("bcc", etBcc.getText().toString().trim());
args.putString("subject", etSubject.getText().toString().trim());
args.putString("body", HtmlHelper.toHtml(etBody.getText()));
if (extras.containsKey("html")) {
args.putString("body", extras.getString("html"));
extras.remove("html");
} else
args.putString("body", HtmlHelper.toHtml(etBody.getText()));
args.putBoolean("empty", isEmpty());
args.putBundle("extras", extras);