mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-14 23:18:43 +00:00
Add double-tap gesture on viewfinder to switch cameras.
This commit is contained in:
@@ -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, _ ->
|
||||
|
||||
Reference in New Issue
Block a user