Class LicensePlateScannerCameraViewModel
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.utils.Router
,io.scanbot.sdk.ui.view.licenseplate.ILicensePlateCameraView.ViewModel
public final class LicensePlateScannerCameraViewModel implements ILicensePlateCameraView.ViewModel, Router
Store LicensePlateScanner view's state and transport user interactions to it.
-
-
Field Summary
Fields Modifier and Type Field Description private final <Error class: unknown class><Boolean>
cameraOpened
private final <Error class: unknown class><Boolean>
stopNewFrames
private final <Error class: unknown class><Boolean>
flash
private final <Error class: unknown class><ILicensePlateCameraView.ViewModel.ConfirmationState>
confirmationState
private LicensePlateScanner
scanner
-
Constructor Summary
Constructors Constructor Description LicensePlateScannerCameraViewModel(LicensePlateScanner scanner)
-
Method Summary
Modifier and Type Method Description <Error class: unknown class><Boolean>
getCameraOpened()
<Error class: unknown class><Boolean>
getStopNewFrames()
<Error class: unknown class><Boolean>
getFlash()
<Error class: unknown class><ILicensePlateCameraView.ViewModel.ConfirmationState>
getConfirmationState()
LicensePlateScanner
getScanner()
Unit
setScanner(LicensePlateScanner scanner)
final Unit
pause()
Unit
onCancelClicked()
User wants to cancel snapping. Unit
onFlashClicked()
User wants to change flash mode. Unit
licensePlateScanned(FrameHandlerResult<LicensePlateScanResult, SdkLicenseError> result)
New frame was processed with license plate scanner Unit
onResultConfirmationPending()
User was shown scanning result confirmation dialogue and we are waiting for his response. Unit
onRestartScanning()
Scanning result confirmation dialogue finished. Unit
onCleanRecognitionQueue()
Allows to clean the accumulated frames inside the recognizer. Unit
onConfirmationRemoved()
View has removed confirmation dialog (to restart scanning), preview resumed. final Unit
setFlashEnabled(Boolean flashEnabled)
Toggles flash. -
-
Constructor Detail
-
LicensePlateScannerCameraViewModel
LicensePlateScannerCameraViewModel(LicensePlateScanner scanner)
-
-
Method Detail
-
getCameraOpened
<Error class: unknown class><Boolean> getCameraOpened()
-
getStopNewFrames
<Error class: unknown class><Boolean> getStopNewFrames()
-
getConfirmationState
<Error class: unknown class><ILicensePlateCameraView.ViewModel.ConfirmationState> getConfirmationState()
-
getScanner
LicensePlateScanner getScanner()
-
setScanner
Unit setScanner(LicensePlateScanner scanner)
-
onCancelClicked
Unit onCancelClicked()
User wants to cancel snapping.
-
onFlashClicked
Unit onFlashClicked()
User wants to change flash mode.
-
licensePlateScanned
Unit licensePlateScanned(FrameHandlerResult<LicensePlateScanResult, SdkLicenseError> result)
New frame was processed with license plate scanner
- Parameters:
result
- LicensePlateScanResult with scanned data
-
onResultConfirmationPending
Unit onResultConfirmationPending()
User was shown scanning result confirmation dialogue and we are waiting for his response.
-
onRestartScanning
Unit onRestartScanning()
Scanning result confirmation dialogue finished.
-
onCleanRecognitionQueue
Unit onCleanRecognitionQueue()
Allows to clean the accumulated frames inside the recognizer. Should be called if reusing the instance after getting the successful result
-
onConfirmationRemoved
Unit onConfirmationRemoved()
View has removed confirmation dialog (to restart scanning), preview resumed. ViewModel is now to adjust its state accordingly.
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Toggles flash.
-
-
-
-