~/talk

Adaptive Layouts in Compose

github:alexvanyo
slides:none on file

Explains why Compose’s composition/layout/draw phases force tradeoffs between first frame correctness and switching which composables run, and shows practical fixes: use window-level sizing (Material 3 adaptive scaffolds), accept subcomposition via SubcomposeLayout or boxWithConstraints but measure for performance, or write a custom layout using intrinsics and TextLayoutResult to measure and place exactly so the same composables are composed yet rendered differently without flicker. Code examples include two-button split, inline badge placement, and ellipsize-with-more-button implementations.

AI-written summary · about

  1. 0:00Adaptive layouts in Compose
  2. 1:08Why adaptive layouts are tricky
  3. 3:16Four conflicting rules in Compose
  4. 5:43Breaking rules for adaptivity
  5. 7:08First frame correctness issues
  6. 12:35Subcomposition for adaptivity
  7. 14:41Window sizing solutions
  8. 17:04Complex layouts same composables
  9. 19:08Custom layout side-by-side buttons
  10. 23:29Custom layout inline text icon
  11. 28:14Conditional button placement
  12. 33:58Choosing the right approach
~/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.