Pause live analysis when displaying a capture

This commit is contained in:
Pierre-Yves Nicolas
2025-06-21 13:15:53 +02:00
parent 0ea4132d37
commit cf1dc97b7e

View File

@@ -95,7 +95,6 @@ fun CameraScreen(
onFinalizePressed: () -> Unit, onFinalizePressed: () -> Unit,
modifier: Modifier, modifier: Modifier,
) { ) {
// TODO pause the live analysis when displaying the PageValidationDialogs
val showPageDialog = rememberSaveable { mutableStateOf(false) } val showPageDialog = rememberSaveable { mutableStateOf(false) }
val isProcessing = rememberSaveable { mutableStateOf(false) } val isProcessing = rememberSaveable { mutableStateOf(false) }
val pageToValidate by viewModel.pageToValidate.collectAsStateWithLifecycle() val pageToValidate by viewModel.pageToValidate.collectAsStateWithLifecycle()
@@ -129,7 +128,7 @@ fun CameraScreen(
captureController = captureController captureController = captureController
) }, ) },
pageCount = viewModel.pageCount(), pageCount = viewModel.pageCount(),
liveAnalysisState, liveAnalysisState = if (showPageDialog.value) LiveAnalysisState() else liveAnalysisState,
onCapture = { onCapture = {
Log.i("MyScan", "Pressed <Capture>") Log.i("MyScan", "Pressed <Capture>")
viewModel.liveAnalysisEnabled = false viewModel.liveAnalysisEnabled = false