~/talk

Custom Drawing with Canvas

Talkat 360|AnDev 2017 · 2017-07-13..07-14· [android]
speakerdeck:jlamson
slides:none on file

Shows how to replace many small Views with a single custom View drawn on android.graphics.Canvas, using actual code: creating Paint objects, computing column widths, drawing axes, grid lines and rectangles for a working bar chart, and a reusable Drawable that draws a circle avatar with centered text. Covers text via static layout and SpannableString, animating values with ValueAnimator, and the performance rule: initialize up front, keep onDraw under 16 ms so the animation runs at 60 fps.

AI-written summary · about

  1. 0:00Intro
  2. 2:30Where do we start
  3. 3:39Getting a Canvas
  4. 4:52Painting
  5. 6:14Navigation
  6. 7:35Bar Chart
  7. 9:07Override View
  8. 10:32Drawing Dimensions
  9. 11:42Drawing Components
  10. 14:06Drawing Individual Bars
  11. 20:28View Groups
  12. 23:15Drawables
  13. 27:17Text Paint
  14. 31:30Text Layouts
  15. 35:07Initialize Colors
  16. 40:33Override Draw
  17. 43:50Review
  18. 44:36Transform Canvas
  19. 45:53Heart Animation
  20. 47:11Questions
~/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.