Digging Deeper with Subcomposition + Custom Compose Layouts
summary
Custom layouts using the layout composable and measurePolicy let code measure children as measurables and produce placeables so the measure and placement phases can be skipped when possible, cutting hundreds of recompositions seen with naive Row-based implementations. Using subcomposeLayout lets the bottom bar be composed and measured first, then the main content be composed with that measurement in the same frame, avoiding the cyclical phase dependency from onGloballyPositioned and nested delays; boxWithConstraints is a simpler subcomposition-backed option.
AI-written summary · about
chapters (10)
- 0:00Custom layouts & subcomposition
- 4:17Why use custom layouts
- 7:54Performance benefits
- 11:45Non-performance reasons
- 15:37Avoiding cyclical dependencies
- 21:49Tooling & productivity impact
- 25:00Subcomposition demo
- 31:45How subcompose layout works
- 37:00When to use subcomposition
- 39:48Summary
related talks
44mDigging Deeper with Subcomposition + Custom Compose Layouts
32mThinking outside the Box: Custom Compose layouts
40mComposing Creatively with Custom Layouts
41mCreating a Custom Compose Layout, Step-By-Step
35mAdaptive Layouts in Compose
42mCreating a Custom Compose Layout, Step-by-Step
25mLazy layouts in Compose
37mAdvanced Layout Animations in Compose
