Thinking outside the Box: Custom Compose layouts
summary
Implements a custom header and a time-graph layout using the layout composable, defines alignment lines on first/last labels and computes bar positions as start/end fractions between those lines, and measures children with exact constraints; demonstrates when to use SubcomposeLayout (dynamic child composition) versus slot-based measurables and warns about its performance cost; builds a lazy layout (lazy time graph) that treats each line as fixed height so scroll offset maps to first-visible index, composes only visible items, and works with an int-consuming scrollableState; uses experimental 1.3 APIs.
AI-written summary · about
chapters (9)
- 0:00Introduction to custom layouts
- 3:57Custom layout theory and basics
- 6:49Header layout implementation
- 8:16Time graph custom layout
- 14:18Subcompose layout explained
- 18:54Lazy layout fundamentals
- 23:52Lazy time graph state
- 29:27Final lazy layout implementation
- 30:49Summary and resources
related talks
41mCreating a Custom Compose Layout, Step-By-Step
40mDigging Deeper with Subcomposition + Custom Compose Layouts
42mCreating a Custom Compose Layout, Step-by-Step
44mDigging Deeper with Subcomposition + Custom Compose Layouts
35mAdaptive Layouts in Compose
20mCustom layouts and graphics in Compose
40mComposing Creatively with Custom Layouts
25mLazy layouts in Compose
