diff --git a/app/src/main/java/eu/faircode/email/ActivitySignature.java b/app/src/main/java/eu/faircode/email/ActivitySignature.java index 7af4d5fb01..bc424d5d10 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySignature.java +++ b/app/src/main/java/eu/faircode/email/ActivitySignature.java @@ -279,13 +279,13 @@ public class ActivitySignature extends ActivityBase { etText.getText().insert(start, ""); else { SpannableStringBuilder ssb = new SpannableStringBuilder(etText.getText()); - ssb.insert(start, "\uFFFC"); // Object replacement character + ssb.insert(start, " \uFFFC"); // Object replacement character String source = uri.toString(); Drawable d = ImageHelper.decodeImage(this, -1, source, true, 0, etText); ImageSpan is = new ImageSpan(d, source); - ssb.setSpan(is, start, start + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + ssb.setSpan(is, start + 1, start + 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); etText.setText(ssb); - etText.setSelection(start + 1); + etText.setSelection(start + 2); } } catch (Throwable ex) { Log.unexpectedError(getSupportFragmentManager(), ex); diff --git a/app/src/main/java/eu/faircode/email/FragmentAnswer.java b/app/src/main/java/eu/faircode/email/FragmentAnswer.java index d947ecfef3..bc4eb5c614 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAnswer.java +++ b/app/src/main/java/eu/faircode/email/FragmentAnswer.java @@ -322,13 +322,13 @@ public class FragmentAnswer extends FragmentBase { int start = etText.getSelectionStart(); SpannableStringBuilder ssb = new SpannableStringBuilder(etText.getText()); - ssb.insert(start, "\uFFFC"); // Object replacement character + ssb.insert(start, " \uFFFC"); // Object replacement character String source = uri.toString(); Drawable d = ImageHelper.decodeImage(getContext(), -1, source, true, 0, etText); ImageSpan is = new ImageSpan(d, source); - ssb.setSpan(is, start, start + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + ssb.setSpan(is, start + 1, start + 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); etText.setText(ssb); - etText.setSelection(start + 1); + etText.setSelection(start + 2); } catch (Throwable ex) { Log.unexpectedError(getParentFragmentManager(), ex); }