The lesser-known world of Spans
summary
Explains that Android uses Spannable types (SpannableString, Spanned) so getString strips spans while getText can return a Spanned, details that Spannable.setSpan accepts any object and spans can overlap. Describes the four flags and that inclusive/exclusive flags control span growth with concrete editor and cursor examples, shows links use URLSpan, spellcheck and meta keys inject spans, demos: per-letter animations via ObjectAnimator, a shimmer via a custom span, a flatten-layout trick, and a small library BetterLinkMovementMethod fixes touch bounds and highlighting.
AI-written summary · about
chapters (11)
- 0:00Introduction to Spans
- 2:06HTML tags and spans quiz
- 5:17How spans work internally
- 7:32Defining spans beyond styling
- 10:21Span flags and behavior
- 13:10Android uses of spans
- 16:02Animating text with spans
- 18:59Flattening layouts with spans
- 20:28Suggestion spans for user input
- 20:49Better link movement method library
- 22:40Closing and resources
related talks
36mSpread your Wings with Spannables
18mDive into Animate Spans with text and performance
37mAndroid Text, The Good The Bad and The ugly
35mBest practices for text on Android
45mTheme On
43mBest Practice for Text on Android and Its Internals
49mThemes, styles & more: from zero to hero
49mThemes, styles & more: from zero to hero
