Barcode Selection

Defined in package com.scandit.datacapture.barcode.selection

BarcodeSelection
class BarcodeSelection : DataCaptureMode

Added in version 8.6.0

Data capture mode that implements barcode selection.

forContext(dataCaptureContext, settings)
fun BarcodeSelection.forContext(dataCaptureContext: DataCaptureContext?,
        settings: BarcodeSelectionSettings): BarcodeSelection

Added in version 8.6.0

Constructs a new barcode selection mode with the provided context and settings. When the context is not null, the capture mode is automatically added to the context.

isEnabled
var isEnabled: Boolean

Added in version 8.6.0

Implemented from DataCaptureMode. See DataCaptureMode.isEnabled.

feedback
var feedback: BarcodeSelectionFeedback

Added in version 8.6.0

Instance of BarcodeSelectionFeedback that is used by barcode selection to notify users about the selection of a barcode.

The default instance of the Feedback will have the sound enabled but no vibration. A default click tone will be used for the sound.

To change the feedback emitted, the BarcodeSelectionFeedback can be modified as shown below, or a new one can be assigned.

val barcodeSelection = ...
barcodeSelection.feedback.selection = Feedback(null, Sound.defaultSound())
setFeedback(soundEnabled, vibrationEnabled)
fun setFeedback(soundEnabled: Boolean,
        vibrationEnabled: Boolean)

Added in version 8.6.0

Convenience method to configure the selection BarcodeSelectionFeedback with the default sound and/or vibration enabled.

dataCaptureContext
val dataCaptureContext: DataCaptureContext?

Added in version 8.6.0

Implemented from DataCaptureMode. See DataCaptureMode.dataCaptureContext.

pointOfInterest
var pointOfInterest: PointWithUnit?

Added in version 8.6.0

The point of interest overwriting the point of interest of the data capture view. By default, this overwriting point of interest is not set and the one from the data capture view is used.

applySettings(settings)
fun applySettings(settings: BarcodeSelectionSettings)

Added in version 8.6.0

Applies the provided BarcodeSelectionSettings to BarcodeSelection.

createRecommendedCameraSettings()
fun BarcodeSelection.createRecommendedCameraSettings(): CameraSettings

Added in version 8.6.0

Returns the recommended camera settings for use with barcode selection.

addListener(listener)
fun addListener(listener: BarcodeSelectionListener)

Added in version 8.6.0

Adds the listener to this barcode selection instance.

In case the same listener is already observing this instance, calling this method will not add the listener again.

removeListener(listener)
fun removeListener(listener: BarcodeSelectionListener)

Added in version 8.6.0

Removes a previously added listener from this barcode selection instance.

In case the listener is not currently observing this instance, calling this method has no effect.

reset()
fun reset()

Added in version 8.6.0

Asynchronously resets the barcode selection session, effectively clearing the history of selected codes.

unfreezeCamera()
fun unfreezeCamera()

Added in version 8.6.0

Unfreeze the camera.

freezeCamera()
fun freezeCamera()

Added in version 8.6.0

Freeze the camera.

selectUnselectedBarcodes()
fun selectUnselectedBarcodes()

Added in version 8.6.0

Select all the unselected barcodes that are being tracked in current the barcode selection session. This action is dispatched asynchronously and may happen on the next frame.

selectAimedBarcode()
fun selectAimedBarcode()

Added in version 8.6.0

Select the barcode being aimed at. Only use this with manual aimer selection.

unselectBarcodes(barcodes)
fun unselectBarcodes(barcodes: List<Barcode>)

Added in version 8.6.0

Removes the barcodes from the list of selected barcodes.

increaseCountForBarcodes(barcodes)
fun increaseCountForBarcodes(barcodes: List<Barcode>)

Added in version 8.6.0

Increments the count of how many times the given barcodes have been selected.

setSelectBarcodeEnabled(barcode, enabled)
fun setSelectBarcodeEnabled(barcode: Barcode,
        enabled: Boolean)

Added in version 8.6.0

Enables or disables the selection of a barcode.

barcodeSelectionLicenseInfo
val barcodeSelectionLicenseInfo: BarcodeSelectionLicenseInfo?

Added in version 8.6.0

The object containing information about barcode selection licensing.

Note

This value is available with a small delay. To make sure it is available, set a DataCaptureContextListener and, as soon as DataCaptureContextListener.onModeAdded() is called, this license object is available.