I use text spans in my app with ImageSpan and text. The text is parsed asynchronously and the ImageSpans are inserted/replaced accordingly. There might be one or more ImageSpans or none at all.
How can I calculate the size beforehand which the final text will take up with ImageSpans included?
The problem I have is, When I finally update the TextView in the RecyclerView item, the whole view "jumps". You can imagine with a lot of list items which are set at different times, the list would appear to be jumping.
I want to eliminate the "jump" by pre-setting the size of the TextView for when the text is displayed, the size of the item is not changed and the list doesn't jump.
Any help or suggestions would be much appreciated.
from SpannableString final display size calculation

No comments:
Post a Comment