~/talk

Measure, Layout, Draw, Repeat: Custom Views and ViewGroups

Talkat 360|AnDev 2016 · 2016-07-28..07-29· [android]
slides:none on file

Shows what actually gets implemented: a working tally counter as a flat custom View and a custom composite ViewGroup list item, drawn on a Canvas with Paint, centered text, and a line under it, and measured with font metrics and resolveSize logic. Covers the three phases measure layout draw, the practical APIs used like onDraw, onMeasure, invalidate and measureChildWithMargins, the four constructors and why allocating in onDraw kills performance, and what still needs work like attributes and accessibility.

AI-written summary · about

  1. 0:00Start
  2. 0:37Why Would You Ever Want To Write Your Own Custom View
  3. 1:50Performance
  4. 5:13How Does Android Draw
  5. 8:07Creating Custom Views
  6. 8:19Extending an Existing View Class
  7. 8:40Flat Custom View
  8. 9:24Composite View Groups
  9. 9:46Composite View Group
  10. 10:05Custom Composite View Group
  11. 11:26Custom Views
  12. 12:55Override the Constructors in the Base View Class
  13. 15:25Translating from Dps and Sps to Pixels
  14. 19:00Invalidate Method
  15. 23:26Layout Parameters
  16. 25:32Set Measure Dimension Is Mandatory
  17. 25:53Setting a Final Size and Position
  18. 26:56Font Metrics
  19. 30:46Custom View Groups
  20. 33:18Xml Layout
  21. 34:05Layout Parameters
  22. 36:47Generate Layout Forums
  23. 38:30Measure Child with Margin
  24. 39:58Measure Child with Margins
  25. 44:19Set Custom Attributes on Your Views
  26. 44:42Accessibility
  27. 46:45Hardware Acceleration
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.