Simplification

pull/217/head
M66B 6 months ago
parent 81e4bfe4af
commit 2335f08078

@ -4196,8 +4196,14 @@ public class HtmlHelper {
if (!(edit instanceof Spannable))
return;
clearComposingText((Spannable) edit);
}
static void clearComposingText(Spannable text) {
if (text == null)
return;
// Copied from BaseInputConnection.removeComposingSpans
Spannable text = (Spannable) edit;
Object[] sps = text.getSpans(0, text.length(), Object.class);
if (sps != null) {
for (int i = sps.length - 1; i >= 0; i--) {
@ -4214,12 +4220,6 @@ public class HtmlHelper {
}
}
static void clearComposingText(Spannable text) {
if (text == null)
return;
BaseInputConnection.removeComposingSpans(text);
}
static Spanned fromHtml(@NonNull String html, Context context) {
Document parsed = JsoupEx.parse(html);
Document document = sanitizeView(context, parsed, false);

Loading…
Cancel
Save