mirror of https://github.com/M66B/FairEmail.git
Allow pasting images
This commit is contained in:
parent
2c027177e7
commit
094bdf00a1
|
@ -22,9 +22,11 @@ package eu.faircode.email;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.style.QuoteSpan;
|
import android.text.style.QuoteSpan;
|
||||||
|
@ -79,7 +81,13 @@ public class EditTextCompose extends FixedEditText {
|
||||||
}
|
}
|
||||||
|
|
||||||
Document document = HtmlHelper.sanitizeCompose(context, html, false);
|
Document document = HtmlHelper.sanitizeCompose(context, html, false);
|
||||||
Spanned paste = HtmlHelper.fromHtml(document.html());
|
Spanned paste = HtmlHelper.fromHtml(document.html(), new Html.ImageGetter() {
|
||||||
|
@Override
|
||||||
|
public Drawable getDrawable(String source) {
|
||||||
|
return ImageHelper.decodeImage(getContext(),
|
||||||
|
-1, source, true, 0, EditTextCompose.this);
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
|
||||||
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||||
int dp3 = Helper.dp2pixels(context, 3);
|
int dp3 = Helper.dp2pixels(context, 3);
|
||||||
|
|
Loading…
Reference in New Issue