A Skeptics Guide to Programmatic Views on Android
summary
Argues for low-level Android UI using concrete APIs: uses Canvas with Paint and Path to draw stateful, animatable shapes instead of XML drawables; implements custom measurement via overriding onMeasure/onLayout to build a fully programmatic vertical list (example: a lolcat row with 60dp image, variable text, spacing) that reduces nesting and improves performance; creates a slider using MotionEvent handled by a state machine (initial → waiting → active) to capture 1–10 values. All examples are implemented and shown working.
AI-written summary · about
chapters (21)
- 0:00Intro
- 2:43An Argument for Programmatic Uls
- 4:05Declarative Uls in Android
- 5:11Overlooked Alternatives
- 5:47The Android Layout System
- 6:11Measurement Phase
- 6:54MeasureSpecs
- 7:57Density Agnostic Measurements
- 8:50Programmatic Unit Conversion
- 9:21Programatic Conversion: Alternative
- 9:46Layout Phase!
- 10:51Layout Method: Alternative
- 11:20Example!
- 12:36VerticalLayout
- 14:34LolCatView
- 18:57Using Canvas
- 19:32Paths & Canvas
- 20:36Xml Approach
- 21:43Canvas Approach
- 23:49Motion Event
- 25:18on Touch Event








