Keep suggestion spans

pull/214/head
M66B 2 years ago
parent a87440e337
commit c878842de2

@ -3938,18 +3938,7 @@ public class HtmlHelper {
} }
static void clearComposingText(TextView view) { static void clearComposingText(TextView view) {
view.clearComposingText(); //view.clearComposingText();
CharSequence text = view.getText();
if (text instanceof Spannable) {
Spannable edit = (Spannable) text;
Object[] spans = edit.getSpans(0, edit.length(), Object.class);
if (spans == null || spans.length == 0)
return;
for (Object span : spans)
if (span instanceof SuggestionSpan)
edit.removeSpan(span);
}
} }
static Spanned fromHtml(@NonNull String html, Context context) { static Spanned fromHtml(@NonNull String html, Context context) {

@ -449,7 +449,7 @@ public class LanguageTool {
continue; continue;
} else } else
Log.i("LT text='" + edit.subSequence(s, e) + "' " + suggestion); Log.i("LT text='" + edit.subSequence(s, e) + "' " + suggestion);
edit.setSpan(span, s, e, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING); edit.setSpan(span, s, e, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
} }

Loading…
Cancel
Save