BarcodeCameraViewModel

class BarcodeCameraViewModel(val scanner: BarcodeScanner, saveBarcodeTakenPictureUseCase: SaveBarcodeTakenPictureUseCase, saveBarcodePreviewFrameUseCase: SaveBarcodePreviewFrameUseCase, barcodeScanningSession: BarcodeScanningSession, dispatchersProvider: IDispatchersProvider) : IBarcodeCameraView.ViewModel, Router

ViewModel for BarcodeCameraView.

Constructors

Link copied to clipboard
constructor(scanner: BarcodeScanner, saveBarcodeTakenPictureUseCase: SaveBarcodeTakenPictureUseCase, saveBarcodePreviewFrameUseCase: SaveBarcodePreviewFrameUseCase, barcodeScanningSession: BarcodeScanningSession, dispatchersProvider: IDispatchersProvider)

Properties

Link copied to clipboard
open override val autoSnapEnabled: <Error class: unknown class><Boolean>
Link copied to clipboard
open override val barcodeFilter: <Error class: unknown class><IBarcodeFilter>
Link copied to clipboard
open override val cameraOpened: <Error class: unknown class><Boolean>
Link copied to clipboard
open override val confirmationState: <Error class: unknown class><IBarcodeCameraView.ViewModel.ConfirmationState>
Link copied to clipboard
open override val flash: <Error class: unknown class><Boolean>
Link copied to clipboard
open override val scanner: BarcodeScanner
Link copied to clipboard
open override val stopNewFrames: <Error class: unknown class><Boolean>

Functions

Link copied to clipboard

User have scanned barcode.

Link copied to clipboard
open override fun onCameraOpened()

Camera has been opened.

Link copied to clipboard
open override fun onCancelClicked()

User wants to cancel snapping.

Link copied to clipboard
open override fun onConfirmationRemoved()

View has removed confirmation dialog (to restart scanning), preview resumed. ViewModel is now to adjust its state accordingly.

Link copied to clipboard
open override fun onFlashClicked()

User wants to change flash mode.

Link copied to clipboard
open override fun onRestartScanning()

Scanning result confirmation dialogue finished.

Link copied to clipboard
open override fun onResultConfirmationPending()

User was shown scanning result confirmation dialogue and we are waiting for his response.

Link copied to clipboard
open override fun onResultConfirmed(result: BarcodeScannerResult)

Barcode scanning result was confirmed in the confirmation dialog.

Link copied to clipboard
open override fun onSelectionOverlayBarcodeClicked(barcodeItem: BarcodeItem)

When the barcode was clicked on the Barcode selection overlay layer.

Link copied to clipboard
open override fun pageSnapped(image: ByteArray, imageOrientation: Int)

User have snapped an image.

Link copied to clipboard
fun pause()
Link copied to clipboard
open override fun setAustraliaPostCustomerFormat(australiaPostCustomerFormat: AustraliaPostCustomerFormat)

The australia post customer format. The default value is AustraliaPostCustomerFormat.ALPHA_NUMERIC.

Link copied to clipboard
open override fun setAutoCancelTimeout(timeoutInSeconds: Int)

Sets auto close timer in seconds. 0 = disabled and it is the default value.

Link copied to clipboard
open override fun setAutomaticSelectionEnabled(enabled: Boolean)

If true - first successfully scanned barcode will be automatically selected in AR overlay and returned as a result, false - default AR overlay behaviour.

Link copied to clipboard
open override fun setAutoStopOnSuccess(enabled: Boolean)

Set if presenter need to stop snapping after first success.

Link copied to clipboard
open override fun setBarcodeFilter(barcodeFilter: IBarcodeFilter)

Set the IBarcodeFilter implementation instance to filter accepted scanned barcodes.

Link copied to clipboard
open override fun setBarcodeFormatsFilter(barcodeFormats: List<BarcodeFormat>)

Set barcode format to scan

Link copied to clipboard
open override fun setConfirmationDialogEnabled(enabled: Boolean)

Enables or disables showing of the confirmation dialog after barcode scanning. By default it is disabled.

Link copied to clipboard
open override fun setDelayAfterScanMs(ms: Long)

Sets a delay after scan in ms. 0 = disabled and it is the default value

Link copied to clipboard
open override fun setEngineMode(engineMode: BarcodeScannerEngineMode)

Allows to set custom BarcodeScannerEngineMode for the barcode scanning.

Link copied to clipboard

Sets list of BarcodeDocumentFormat to scan

Link copied to clipboard
fun setFlashEnabled(flashEnabled: Boolean)

Enables/disables flash.

Link copied to clipboard
open override fun setGs1HandlingMode(gs1Handling: Gs1Handling)

GS1 Codes Handling mode. The default value is Gs1Handling.PARSE.

Link copied to clipboard
open override fun setInitialScanDelayMs(ms: Long)

Sets initial scan timeout in ms. 0 = disabled and it is the default value

Link copied to clipboard
open override fun setLowPowerMode(lowPowerMode: Boolean)

If true, enabled the mode which slightly decreases the scanning quality and the energy consumption, and increases the scanning speed. If false - mode is disabled. The default is false

Link copied to clipboard
open override fun setMaximumTextLength(maximumTextLength: Int)

Set maximum text length of the scanned barcode. Setting to zero removes the limit. The default value is 0 (the setting is turned off). NOTE: Currently works for ITF and MSI Plessey barcodes only!

Link copied to clipboard
open override fun setMinimum1DQuietZoneSize(minimum1DQuietZoneSize: Int)

Set minimum required quiet zone on the barcode. Measured in modules (the size of a minimal bar on the barcode). The default value is 10. NOTE: Currently works for ITF and MSI Plessey barcodes only!

Link copied to clipboard
open override fun setMinimumTextLength(minimumTextLength: Int)

Set minimum required text length of the scanned barcode. The default value is 0 (the setting is turned off). NOTE: Currently works for ITF and MSI Plessey barcodes only!

Link copied to clipboard
open override fun setMsiPlesseyChecksumAlgorithms(msiPlesseyChecksumAlgorithms: List<MsiPlesseyChecksumAlgorithm>)

The checksum algorithms for MSI Plessey barcodes. The default value is MSIPlesseyChecksumAlgorithm.Mod10.

Link copied to clipboard
open override fun setStripCheckDigits(stripCheckDigits: Boolean)

If true, check digits for UPC, EAN and MSI Plessey codes are removed from result. Has no effect if both single and double digit MSI Plessey checksums are enabled. The default is false

Link copied to clipboard
open override fun setUseCode11Checksum(useCode11Checksum: Boolean)

If true, the Code 11 barcode checksum is used. Default is true

Link copied to clipboard
open override fun setUseIata2Of5Checksum(useIata2Of5Checksum: Boolean)

If true, the IATA 2 of 5 barcode checksum is used. Default is true