Session
Native CameraX in Jetpack Compose - Filling the View-Shaped Hole
For years, CameraX in Compose felt like a second-class citizen. Wrapping PreviewView in AndroidView created a "View-shaped hole" that complicated lifecycles, broke Z-ordering, and made gesture handling a mathematical nightmare.
That era ends now. With the new camera-compose artifact, we finally have a native solution.
In this session, we will migrate from legacy wrappers to the new CameraXViewfinder. We’ll explore a reactive architecture where CameraX publishes SurfaceRequest objects to a StateFlow that your UI consumes.
We will dive deep into:
- CoordinateTransformer: Solving "tap-to-focus" math in a single line, handling sensor rotation and scaling automatically.
- Implementation Modes: Choosing between EXTERNAL (SurfaceView) and EMBEDDED (TextureView) for the right balance of battery life vs. animation support.
- Production Patterns: Handling permissions, foldables, and lifecycles cleanly.
- Stop bridging two worlds. It’s time to make your camera code as beautiful as your UI.
Ioannis Anifantakis
Staff Android Engineer at novibet
Irákleion, Greece
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top