Spans strange behavior

65 Views Asked by At

Spans, behaving strangely

Prerequisite

I've create a simple project with an EditText and a string "Hello World!" inside. The EditText has a StyleSpan(Typeface.BOLD) applied to it using editText.editableText.setSpan(span, 6, 11, Spannable.SPAN_INCLUSIVE_EXCLUSIVE).

The problem

As you can see from the gif above, when the space between the words "Hello" and "World" is removed, and the ending letters of the new merged word start being deleted, the whole word gets spanned. Does anybody have any ideas what might be causing them to behave this way?

A link to the repository where you can get more details

0

There are 0 best solutions below