Add double-tap gesture on viewfinder to switch cameras.

This commit is contained in:
Greyson Parrelli
2026-02-06 15:10:10 -05:00
parent 5575f75118
commit 13435c0b54

View File

@@ -138,16 +138,21 @@ fun CameraScreen(
.fillMaxSize()
.clip(cornerShape)
.pointerInput(Unit) {
detectTapGestures { offset ->
emitter(
CameraScreenEvents.TapToFocus(
x = offset.x,
y = offset.y,
width = size.width.toFloat(),
height = size.height.toFloat()
detectTapGestures(
onDoubleTap = {
emitter(CameraScreenEvents.SwitchCamera(context))
},
onTap = { offset ->
emitter(
CameraScreenEvents.TapToFocus(
x = offset.x,
y = offset.y,
width = size.width.toFloat(),
height = size.height.toFloat()
)
)
)
}
}
)
}
.pointerInput(Unit) {
detectTransformGestures { _, _, zoom, _ ->