Barcode Sequence Highlight

Defined in package com.scandit.datacapture.barcode.sequence.ui.highlight

BarcodeSequenceHighlight
interface BarcodeSequenceHighlight

Added in version 8.5.4

A highlight you supply, drawn over one sequenced barcode in place of the built-in circle. Supply one per barcode through BarcodeSequenceHighlightProvider.

The view is created once and lives as long as the barcode is tracked. Reordering, rejection and pausing are reported through onOrderOnTrayChanged() and onStateChanged(), and none of them replaces the view or asks the provider again.

Per-barcode state belongs on the highlight instance, which has the same lifetime as the view. The SequencedBarcode handed to the provider is built per request and is not an identity to key on.

Supply a separate view for each barcode. Returning one that is already highlighting another barcode moves it to the new one and leaves the old highlight empty.

createView(context)
fun createView(context: Context): View

Added in version 8.5.4

Called once to create the view drawn over the barcode. Called from the main thread.

onStateChanged() and onOrderOnTrayChanged() are both called once right after this method, with the initial values.

The view is kept centered on the barcode’s location at its own measured size, and is never resized, reshaped or rotated, so it must have an intrinsic size.

onStateChanged(view, state)
fun onStateChanged(view: View,
        state: BarcodeSequenceState)

Added in version 8.5.4

Called from the main thread whenever the state of the BarcodeSequenceView changes.

onOrderOnTrayChanged(view, orderOnTray)
fun onOrderOnTrayChanged(view: View,
        orderOnTray: Int)

Added in version 8.5.4

Called from the main thread whenever the position of the barcode on its tray changes.

orderOnTray is 0-based and is negative when the barcode is not associated with a tray, which is the only signal a rejected barcode carries. The built-in highlight displays orderOnTray + 1.