~/talk

Mastering Jetpack Compose Previews - Test your UI before it tests you!

Talkat Android Worldwide January 2024 · on Tuesday, 2024-01-30· [android, design-collaboration]
speakerdeck:sindkarp
slides:none on file

Live demo of Jetpack Compose Previews shows concrete techniques: add the tooling dependency, create multiple previews for specific DP sizes and devices, use live edit and dynamic wallpaper colors, run interactive previews and animation frame-by-frame, and generate arrays of previews for font scaling (100%–200%). Uses PreviewParameterProvider to inject realistic UI state because previews don’t load network or ViewModel data; multiple-previews require Compose 1.6.0-alpha01 and Android Studio Hedgehog. Limitations and workarounds are demonstrated.

AI-written summary · about

  1. 0:00Jetpack Compose Previews intro
  2. 1:07Preview annotations setup
  3. 2:31Preview names
  4. 3:13UI testing dimensions
  5. 4:18Previews on Android devices
  6. 5:02Tablet responsiveness
  7. 5:44Font scaling accessibility
  8. 6:49Localization testing
  9. 7:09Previews with system UI
  10. 8:11Light/dark mode colors
  11. 8:55Live Edit dynamic colors
  12. 10:01Wallpaper dynamic colors
  13. 11:03Real device previews
  14. 12:26Interactive UI in previews
  15. 13:52Interactive components testing
  16. 14:34Animations fine-tuning
  17. 17:23Multiple previews font scaling
  18. 19:12Screen size previews
  19. 20:59Preview parameter providers
  20. 23:31Navigating composables
  21. 27:28Previews limitations
  22. 28:52ViewModels in previews
  23. 29:38Q&A
~/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.