mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
5112bca339
commit
d98ee009aa
|
@ -179,7 +179,7 @@ public class ActivityEML extends ActivityBase {
|
|||
if (html != null) {
|
||||
Document parsed = JsoupEx.parse(html);
|
||||
Document document = HtmlHelper.sanitizeView(context, parsed, false);
|
||||
result.body = HtmlHelper.fromHtml(document.html());
|
||||
result.body = HtmlHelper.fromDocument(document);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -1924,7 +1924,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
|
||||
// Draw images
|
||||
Spanned spanned = HtmlHelper.fromHtml(document.html(), new Html.ImageGetter() {
|
||||
Spanned spanned = HtmlHelper.fromDocument(document, new Html.ImageGetter() {
|
||||
@Override
|
||||
public Drawable getDrawable(String source) {
|
||||
Drawable drawable = ImageHelper.decodeImage(context, message.id, source, show_images, zoom, tvBody);
|
||||
|
|
|
@ -78,7 +78,7 @@ public class EditTextCompose extends FixedEditText {
|
|||
html = "<div>" + HtmlHelper.formatPre(text.toString()) + "</div>";
|
||||
}
|
||||
Document document = HtmlHelper.sanitizeCompose(context, html, false);
|
||||
Spanned paste = HtmlHelper.fromHtml(document.html());
|
||||
Spanned paste = HtmlHelper.fromDocument(document);
|
||||
|
||||
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||
|
||||
|
|
|
@ -1748,6 +1748,14 @@ public class HtmlHelper {
|
|||
return false;
|
||||
}
|
||||
|
||||
static Spanned fromDocument(@NonNull Document document) {
|
||||
return fromDocument(document, null, null);
|
||||
}
|
||||
|
||||
static Spanned fromDocument(@NonNull Document document, @Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
|
||||
return fromHtml(document.html(), imageGetter, null);
|
||||
}
|
||||
|
||||
static Spanned fromHtml(@NonNull String html) {
|
||||
return fromHtml(html, null, null);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue