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>cameraOpenedprivate final <Error class: unknown class><Boolean>stopNewFramesprivate final <Error class: unknown class><Boolean>flashprivate final <Error class: unknown class><ILicensePlateCameraView.ViewModel.ConfirmationState>confirmationStateprivate LicensePlateScannerscanner
-
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()LicensePlateScannergetScanner()UnitsetScanner(LicensePlateScanner scanner)final Unitpause()UnitonCancelClicked()User wants to cancel snapping. UnitonFlashClicked()User wants to change flash mode. UnitlicensePlateScanned(FrameHandlerResult<LicensePlateScanResult, SdkLicenseError> result)New frame was processed with license plate scanner UnitonResultConfirmationPending()User was shown scanning result confirmation dialogue and we are waiting for his response. UnitonRestartScanning()Scanning result confirmation dialogue finished. UnitonCleanRecognitionQueue()Allows to clean the accumulated frames inside the recognizer. UnitonConfirmationRemoved()View has removed confirmation dialog (to restart scanning), preview resumed. final UnitsetFlashEnabled(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.
-
-
-
-