~/talk

Compose-View Interop in Practice

Talkat droidcon San Francisco 2023 · 2023-06-08..06-09· [android]
slides:none on file

Shows how to host existing view libraries like MPAndroidChart inside Compose with AndroidView, and how to embed Compose into XML using ComposeView and the lesser-known ComposeViewAdapter to render parameterized previews (you pick parameterProviderIndex to choose which preview data appears). Demonstrates building a business‑critical custom button and a banner pager, testing interactions with Compose testing + Espresso interoperability, and creating view-backed composables via abstractComposeView. Notes: XML preview needs Android Studio Giraffe Canary 8+, and each ComposeView owns a composition so many ComposeViews can hurt performance.

AI-written summary · about

  1. 0:00Introduction and disclaimer
  2. 0:52What is Compose-View interop
  3. 2:19Using Android View in Compose
  4. 4:28Testing hybrid UIs with Espresso
  5. 6:33Adding Compose to View layouts
  6. 9:04Compose View Adapter for previews
  7. 16:03Wrapping Composables with Views
  8. 22:48Pros and cons of interop
  9. 25:18Resources and key takeaways
  10. 27:25Q&A
~/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.