ScanningUx

fun ScanningUx(modifier: Modifier, uiState: BaseUiState, onExitScanning: () -> Unit, uiSettings: UiSettings, helpScreens: HelpScreens, errorStateDialogs: Map<ErrorState, @Composable () -> Unit>, allowHapticFeedback: Boolean, allowScanSound: Boolean = true, showProductionOverlay: Boolean, showDemoOverlay: Boolean, onTorchStateChange: () -> Unit, onFlipDocumentAnimationCompleted: () -> Unit, onReticleSuccessAnimationCompleted: () -> Unit, onHapticFeedbackCompleted: () -> Unit, onScanSoundCompleted: () -> Unit = {}, onChangeOnboardingDialogVisibility: (Boolean) -> Unit, onHelpScreensDisplayRequested: () -> Unit, onHelpScreensCloseRequested: (allPagesDisplayed: Boolean) -> Unit, onChangeHelpTooltipVisibility: (Boolean) -> Unit)

Composable function that provides the user interface for the scanning screen, including the reticle, instruction messages, buttons, and dialogs.

This function is responsible for rendering all the UI elements visible during the document scanning process, except for the camera preview itself. It handles displaying the reticle, instruction messages, exit and torch buttons, help components, and various dialogs based on the provided UI state and settings.

Parameters

modifier

The Modifier to be applied to the outermost container of the UI.

uiState

The BaseUiState containing the current state of the UI.

onExitScanning

A callback function invoked when the user wants to exit the scanning process.

uiSettings

The UiSettings used to configure the UI.

helpScreens

The HelpScreens containing onboarding and help dialog content.

errorStateDialogs

A map of ErrorState to composable error dialogs.

allowHapticFeedback

Whether haptic feedback is allowed during the scanning process.

allowScanSound

Whether scan success sounds are allowed during the scanning process.

showProductionOverlay

A Boolean defining whether a Microblink logo overlay will be shown during scanning. The setting value is defined by license and shouldn't be modified.

showDemoOverlay

A Boolean defining whether a Powered by Microblink text overlay will be shown during scanning. The setting value is defined by license and shouldn't be modified.

onTorchStateChange

A callback function invoked when the user wants to change the torch state.

onFlipDocumentAnimationCompleted

A callback function invoked when the flip document animation is completed.

onReticleSuccessAnimationCompleted

A callback function invoked when the reticle success animation is completed.

onHapticFeedbackCompleted

A callback function invoked when the haptic feedback is completed.

onScanSoundCompleted

A callback function invoked when the scan sound playback is completed.

onChangeOnboardingDialogVisibility

A callback function invoked when the visibility of the onboarding dialog should change.

onHelpScreensDisplayRequested

A callback function invoked when help screens should be displayed.

onHelpScreensCloseRequested

A callback function invoked when help screens should be closed.

onChangeHelpTooltipVisibility

A callback function invoked when the visibility of the help tooltip should change.