Measure. Layout. Draw. Repeat: Custom Views and ViewGroups
summary
Argues that custom Views and ViewGroups let Android UIs get unique looks, better performance, and reusable components by showing concrete code: builds a working tally counter (Canvas, Paint, text measurement, calls invalidate to redraw) and a composite list-item view group that measures and lays out children (uses measure specs and measureChildWithMargins), explains onFinishInflate timing, warns that RelativeLayout may measure twice so nesting costs explode, and fixes a hidden button by implementing onMeasure correctly.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 5:29Flat Custom Views
- 11:51Count Counter
- 12:18Constructors
- 17:51Tally Counter
- 20:06Draw Tips
- 21:36Measure
- 29:14ViewGroups
- 31:44Practice
- 32:06Custom ViewGroup
- 33:08Layout Parameters
- 36:05ViewGroup Methods
- 38:04Measure Layout
related talks
51mMeasure, Layout, Draw, Repeat: Custom Views and ViewGroups
40mWriting Custom Views for Android
30mLet’s Sprinkle some #PerfMatters on your ViewGroups
32mA Skeptics Guide to Programmatic Views on Android
27mCustom Views - The Definitive Guide
26mThe Importance of Measure
35mMake It Fit, how Android measures and draws views
40mPlease, Draw Me a View
