~/talk

Building a Compose-idiomatic CameraX Viewfinder

Talkat droidcon New York 2024 · 2024-09-19..09-20· [android]
links:none on file
slides:none on file

Built a native Compose viewfinder for CameraX that replaces the stateful Preview wrapper with a stateless Compose API requiring a SurfaceRequest, Modifier, implementation mode (SurfaceView/TextureView) and a mutable coordinate transformer; it composes AndroidExternalSurface/EmbeddedExternalSurface into a TransformSurface that applies CameraX’s TransformationInfo (rotation, mirroring, crop rect) via a matrix and an Offset extension for tap-to-focus mapping, ships an alpha release last week, is Camera2-compatible, and reports better ergonomics and easier integration in real apps.

AI-written summary · about

  1. 0:00CameraX Viewfinder intro
  2. 1:26Core viewfinder requirements
  3. 4:44Handling frame transforms
  4. 7:16Compose-idiomatic approach
  5. 9:25SurfaceProvider explained
  6. 11:59Traditional Preview challenges
  7. 13:01Native Compose viewfinder
  8. 16:56Surface layout in Compose
  9. 21:13Viewfinder architecture
  10. 21:54Touch-to-focus mapping
  11. 24:46Final API and usage
  12. 26:52Sample app and release
  13. 27:34Implementation learnings
  14. 29:01Q&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.