If you are looking for a kind of bubble . You can achieve this by creating a subclass of android.text.style.DynamicDrawableSpan.ImageSpan that converts part of the EditText string to a formatted span .
This SO question will give you some general idea of ββcreating a formatted range.
This is a good guide to configure editext with spans .
And to delete the entire word at the same time, you can use the SPAN_EXCLUSIVE_EXCLUSIVE property.
Below the code will format the first four characters of the string. Hope this gives you some hint.
final SpannableStringBuilder sb = new SpannableStringBuilder("your text here"); final ForegroundColorSpan fcs = new ForegroundColorSpan(Color.rgb(158, 158, 158));
source share