Shutter effect on capture

This commit is contained in:
Pierre-Yves Nicolas
2025-06-27 08:13:06 +02:00
parent d51f407f07
commit 6361e1616f

View File

@@ -277,6 +277,16 @@ private fun CameraPreviewWithOverlay(
) { ) {
val width = LocalConfiguration.current.screenWidthDp val width = LocalConfiguration.current.screenWidthDp
val height = width / 3 * 4 val height = width / 3 * 4
var showShutter by remember { mutableStateOf(false) }
LaunchedEffect(cameraUiState.captureState.frozenImage) {
if (cameraUiState.captureState.frozenImage != null) {
showShutter = true
delay(200)
showShutter = false
}
}
Box( Box(
modifier = Modifier modifier = Modifier
.width(width.dp) .width(width.dp)
@@ -291,6 +301,13 @@ private fun CameraPreviewWithOverlay(
) )
} }
if (showShutter) {
Box(
modifier = Modifier
.matchParentSize()
.background(Color.Black.copy(alpha = 0.6f))
)
}
} }
} }