I set span for spannableText and set it to TextView. After i want get width and height of this text. But the result does not take into account the change in the size of the text due to the set span. Next solution is work incorrect.
return textView.getPaint().measureText(text, 0, text.length());