Android Text, The Good The Bad and The ugly
summary
Covers concrete Android Text fixes: turn off hyphenation (default causes ~2.5× slower layout on many devices), use precomputed text + RecyclerView prefetch to move measurement off the UI thread and gain up to 10× faster text measurement (cost ~20 KB per 500 chars), avoid setText churn by prebuilding Spannables and setting a custom SpannableFactory to skip copies, avoid runtime Linkify in bind, and use BreakIterator when implementing length filters to handle multi-codepoint emoji correctly.
AI-written summary · about
chapters (13)
- 0:00Introduction to Android text
- 1:56Disabling hyphenation for performance
- 4:29Precomputed text with RecyclerView
- 7:21How native text measurement works
- 13:06Inflation and text view count
- 14:56Performance pitfalls with setText
- 18:29Efficient span checks and usage
- 20:15Optimizing spannable strings
- 22:24Autolink performance issues
- 23:29Editable text and performance
- 26:01Input method and text changes
- 28:51Input filter and length limits
- 35:56Resources and Q&A
related talks
35mBest practices for text on Android
43mBest Practice for Text on Android and Its Internals
15mUse Android text like a pro
36mBest practices for using text in Android
41mAndroid Textual Layout
46mTypesetting: designing and building beautiful text layouts
40mWhat's New (?) in Android Text Over the Past Few Years
23mThe lesser-known world of Spans
