Shutter effect on capture
This commit is contained in:
@@ -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))
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user