From 106e02a385acca8af826eea100a2dc07dfbf4436 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 20 Aug 2021 20:56:11 +0200 Subject: [PATCH] Fixed direct inline images --- .../eu/faircode/email/FragmentCompose.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 0e80cd29fa..e369d421ee 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -4961,6 +4961,26 @@ public class FragmentCompose extends FragmentBase { if (draft.content && state == State.NONE) showDraft(draft); + if (args.containsKey("images")) { + ArrayList images = args.getParcelableArrayList("images"); + args.remove("images"); // once + + boolean image_dialog = prefs.getBoolean("image_dialog", true); + if (image_dialog) { + Helper.hideKeyboard(view); + + Bundle aargs = new Bundle(); + aargs.putInt("title", android.R.string.ok); + aargs.putParcelableArrayList("images", images); + + FragmentDialogAddImage fragment = new FragmentDialogAddImage(); + fragment.setArguments(aargs); + fragment.setTargetFragment(FragmentCompose.this, REQUEST_SHARED); + fragment.show(getParentFragmentManager(), "compose:shared"); + } else + onAddImageFile(images); + } + tvDsn.setVisibility( draft.dsn != null && !EntityMessage.DSN_NONE.equals(draft.dsn) ? View.VISIBLE : View.GONE); @@ -4974,24 +4994,6 @@ public class FragmentCompose extends FragmentBase { } } }); - - if (args.containsKey("images")) { - ArrayList images = args.getParcelableArrayList("images"); - boolean image_dialog = prefs.getBoolean("image_dialog", true); - if (image_dialog) { - Helper.hideKeyboard(view); - - Bundle aargs = new Bundle(); - aargs.putInt("title", android.R.string.ok); - aargs.putParcelableArrayList("images", images); - - FragmentDialogAddImage fragment = new FragmentDialogAddImage(); - fragment.setArguments(aargs); - fragment.setTargetFragment(FragmentCompose.this, REQUEST_SHARED); - fragment.show(getParentFragmentManager(), "compose:shared"); - } else - onAddImageFile(images); - } } @Override