~/talk

Level Up Your Extension Game

Talkat droidcon SF 2019 · 2019-11-18..11-19· [android, kotlin]
slides:none on file

Shows concrete rules and pitfalls for Kotlin extension functions with examples that compile and interop with Java, including using Android KTX to replace 70+ lines of Spannable setup with simple span extensions, how to declare a receiver (domesticAnimal.toAnimal), and how to call extensions from Java via the generated class mappersKt while noting inline only extensions are invisible to Java. Warns against extending common types like String for business logic, mutating receiver members, over-extending Context vs Activity, and recommends nullable receiver checks, type-to-type conversions, and iterator extensions for view groups.

AI-written summary · about

  1. 0:00Introduction
  2. 1:15Why extension functions
  3. 3:01Creating extension functions
  4. 4:50Bad practices explained
  5. 7:40Context extension pitfalls
  6. 9:47Good practices overview
  7. 12:18Core KTX benefits
~/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.