In‑Depth: ViewGroup Layout Internal Implementation
summary
Explains Android view measurement and layout internals: ViewGroup dispatches measure→layout top-down. FrameLayout re-measures children with EXACT specs if the parent shrinks. LinearLayout performs two measurement passes to implement weight, skipping the first pass for children with 0dp+weight. ConstraintLayout builds a parallel widget tree and resolves constraints with a LinearSystem solver (Simplex / solver library) and a fast Optimizer path, sometimes invoking the solver and widget layout up to three times to converge.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 2:59ViewGroup layout flow
- 4:43Measure vs onMeasure
- 6:56MeasureSpec explained
- 8:22Layout vs onLayout
- 10:14FrameLayout internals
- 12:59LinearLayout internals and weights
- 15:38ConstraintLayout math basis
- 17:11Linear programming basics
- 19:02Cassowary algorithm
- 21:14ConstraintLayout internals
- 23:23ConstraintLayout onMeasure
- 27:43ConstraintLayout onLayout
- 28:27ConstraintLayout Optimizer
- 29:32Summary & Q&A
related talks
35mLoving Lean Layout
42mMeasure. Layout. Draw. Repeat: Custom Views and ViewGroups
41mLoving Lean Layouts
30mLet’s Sprinkle some #PerfMatters on your ViewGroups
51mMeasure, Layout, Draw, Repeat: Custom Views and ViewGroups
19mConstraint Layout
26mThe Importance of Measure
29mDemystifying Constraint Layout
