~/talk

Practical Tips and Tricks to Improve Your Compose Previews

Talkat Android Worldwide July 2024 · on Tuesday, 2024-07-30· [android]
slides:none on file

Explains concrete, usable techniques: use preview-annotation parameters like showBackground and backgroundColor and uiMode to get accurate light/dark previews, group previews with group/multi-preview constants, and build reusable annotation wrappers and a preview Box composable that applies Theme, deferred CompositionLocal reads, padding and background so previews render reliably. Shows interactive previews, preliminary accessibility checks, screenshot testing and PreviewParameterProvider for multiple states. Works in Android Studio; Compose Multiplatform tooling (Fleet) currently ignores annotation parameters. R8 strips preview-only code from releases.

AI-written summary · about

  1. 0:00Intro
  2. 0:50Food for Thought
  3. 4:10Tip 1 Themes
  4. 12:50Tip 3 Grouping Previews
  5. 15:41Tip 4 Multi Previews
  6. 20:48Tip 5 Custom Preview Tools
  7. 28:04Tip 6 Preview Overrides
  8. 29:54Other Ideas
  9. 34:24Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.