Barcode Count AIO View

Defined under the namespace Scandit.Datacapture.Barcode.Count.Ui

BarcodeCountAioView
class BarcodeCountAioView

Added in version 8.7.0

An all-in-one React component for Barcode Count. Rendering this single element replaces the manual assembly of a DataCaptureContext, a BarcodeCount mode and a BarcodeCountView — the component owns all of them, along with its camera claim and its lifecycle.

The component must be rendered inside a ScanditProvider, which supplies the DataCaptureContext and the shared camera. Scanning starts once the component is mounted and enabled, and stops when it unmounts.

Configuration is passed through BarcodeCountAioViewProps. To gain manual control over the component, attach a React ref typed as BarcodeCountAioViewHandle. Interactions are reported through BarcodeCountAioUiListener and BarcodeCountAioViewListener.

To build your first screen with the AIO components, refer to the AIO components getting started guide. For the classic API, refer to the MatrixScan Count Get Started guide.

BarcodeCountAioViewProps
interface BarcodeCountAioViewProps

Added in version 8.7.0

Configuration for BarcodeCountAioView.

A settings source is required: pass either symbologies or barcodeCountSettings. Both are optional on this interface, but BarcodeCountAioView requires one of them, so rendering the component with neither is a compile error. Supplying both is allowed, and barcodeCountSettings takes precedence. Every other prop is optional.

didScan(barcodes, session, getFrameData)
didScan?(barcodes: Barcode[],
        session: BarcodeCountSession,
        getFrameData: () => Promise<FrameData | null>): void | Promise<void>

Added in version 8.7.0

Called on each scan, with the barcodes taken from BarcodeCountSession.recognizedBarcodes.

Return a promise to keep the frame alive while asynchronous work runs. getFrameData() resolves to the FrameData for the frame, and becomes invalid once the returned promise resolves.

Backed by the native BarcodeCountListener.didScan() event, so it fires only on a recognition, independently of didUpdateSession().

didUpdateSession(session, getFrameData)
didUpdateSession?(session: BarcodeCountSession,
        getFrameData: () => Promise<FrameData | null>): void | Promise<void>

Added in version 8.7.0

Called on every session update, regardless of whether a barcode was recognized. Backed by the native BarcodeCountListener.onSessionUpdated() event and independent of didScan().

symbologies
symbologies?: Symbology[]

Added in version 8.7.0

Symbologies to enable. Shorthand for BarcodeCountSettings.enabledSymbologies; ignored when barcodeCountSettings is set.

barcodeCountSettings
barcodeCountSettings?: BarcodeCountSettings | null

Added in version 8.7.0

The settings applied to the underlying mode, as a complete BarcodeCountSettings object. Takes precedence over symbologies; when both are given, the shorthand is ignored and a warning is logged.

captureList
captureList?: BarcodeCountCaptureList | null

Added in version 8.7.0

Enables “Scanning against a list” mode, which provides additional functionality when looking for a specific set of Barcodes.

additionalBarcodes
additionalBarcodes?: Barcode[] | null

Added in version 8.7.0

Barcodes to count in addition to those recognized from the camera feed, such as ones entered by hand.

uiListener
uiListener?: BarcodeCountAioUiListener

Added in version 8.7.0

Listener that receives callbacks when the view’s own buttons are tapped. See BarcodeCountAioUiListener.

listener
listener?: BarcodeCountAioViewListener

Added in version 8.7.0

Listener that supplies per-barcode brushes and receives callbacks when a TrackedBarcode is tapped. See BarcodeCountAioViewListener.

feedback
feedback?: BarcodeCountFeedback

Added in version 8.7.0

Sound and vibration feedback emitted on scan, as a BarcodeCountFeedback. Omit to use the SDK default, which enables both sound (a beep) and vibration.

toolbarSettings
toolbarSettings?: BarcodeCountToolbarSettings

Added in version 8.7.0

Text and accessibility overrides for the in-view toolbar toggle buttons.

statusProvider
statusProvider?: BarcodeCountStatusProvider | null

Added in version 8.7.0

Provider that drives the status icons and status mode.

Required whenever shouldShowStatusIconsOnScan is true; without a provider, every scan aborts.

shouldShowStatusIconsOnScan
shouldShowStatusIconsOnScan?: boolean

Added in version 8.7.0

Whether status icons are shown immediately after barcodes are scanned, without manually activating status mode.

navigation
navigation?: ScanditNavigationProp

Added in version 8.7.0

Navigation object for the screen the component is rendered on, for example React Navigation’s navigation prop (typed as ScanditNavigationProp). When it is provided, scanning is suspended — the mode is disabled and the camera turned off — while the screen is blurred or the application is backgrounded, and resumed when the screen regains focus. Ignored while disabled is set.

disabled
disabled?: boolean

Added in version 8.7.0

Set to true to keep scanning off. Leaving it false does not keep scanning on — navigation and app-state handling still turn the mode on and off on their own.

BarcodeCountAioViewHandle.enable() and BarcodeCountAioViewHandle.disable() change the same state directly. If you call those, this prop no longer reflects whether the component is actually scanning.

appStateHandlingDisabled
appStateHandlingDisabled?: boolean

Added in version 8.7.0

Turns off the automatic enabling and disabling of the mode in response to the application moving between foreground and background.

viewStyle
viewStyle?: BarcodeCountViewStyle

Added in version 8.7.0

The view style. Defaults to BarcodeCountViewStyle.Dot.

shouldDisableModeOnExitButtonTapped
shouldDisableModeOnExitButtonTapped?: boolean

Added in version 8.7.0

Whether the mode is disabled automatically when the exit button is tapped. Defaults to true.

shouldShowUserGuidanceView
shouldShowUserGuidanceView?: boolean

Added in version 8.7.0

Whether user guidance and the loading view are shown. The user guidance prompts the user to scan, and to move closer or further away from the target barcodes in order to scan them properly. Defaults to true.

shouldShowListButton
shouldShowListButton?: boolean

Added in version 8.7.0

Whether a list button is shown in the lower left corner of the screen. Tapping it freezes the mode unless shouldDisableModeOnExitButtonTapped is false, and calls BarcodeCountAioUiListener.didTapListButton().

shouldShowExitButton
shouldShowExitButton?: boolean

Added in version 8.7.0

Whether an exit button is shown in the lower right corner of the screen. The button does nothing on its own; tapping it calls BarcodeCountAioUiListener.didTapExitButton().

shouldShowShutterButton
shouldShowShutterButton?: boolean

Added in version 8.7.0

Whether a shutter button is shown centered at the bottom of the screen. Tapping it triggers the processing of the current video feed, the same as calling BarcodeCount.startScanningPhase(). Defaults to true.

shouldShowHints
shouldShowHints?: boolean

Added in version 8.7.0

Whether hints about the currently scanned barcodes are shown. Defaults to true.

shouldShowClearHighlightsButton
shouldShowClearHighlightsButton?: boolean

Added in version 8.7.0

Whether a button that clears all currently shown barcode highlights is shown above the shutter button.

shouldShowSingleScanButton
shouldShowSingleScanButton?: boolean

Added in version 8.7.0

Whether a single scan button is shown in the lower left corner of the preview. The button does nothing on its own; tapping it calls BarcodeCountAioUiListener.didTapSingleScanButton().

shouldShowFloatingShutterButton
shouldShowFloatingShutterButton?: boolean

Added in version 8.7.0

Whether a floating shutter button is shown. It can be dragged to any position and, when tapped, triggers the processing of the current video feed. Defaults to false.

shouldShowToolbar
shouldShowToolbar?: boolean

Added in version 8.7.0

Whether a collapsible toolbar is shown at the top of the preview, with convenience buttons for changing preferences during scanning. Defaults to true.

shouldShowStatusModeButton
shouldShowStatusModeButton?: boolean

Added in version 8.7.0

Whether a status mode button is shown in the lower right corner of the preview. It toggles “status mode”, in which the barcode highlights are replaced by status indicators for each barcode.

shouldShowScanAreaGuides
shouldShowScanAreaGuides?: boolean

Added in version 8.7.0

Whether the view renders scan-area guides. Defaults to false. Useful during development to check that the scan area of the view is positioned correctly; not intended for production.

shouldShowListProgressBar
shouldShowListProgressBar?: boolean

Added in version 8.7.0

Whether a progress bar is shown when a capture list is set, indicating how many of the barcodes in the list have been scanned.

shouldShowTorchControl
shouldShowTorchControl?: boolean

Added in version 8.7.0

Whether the torch control button is shown. Defaults to false.

logoStyle
logoStyle?: LogoStyle

Added in version 8.7.0

The style of the Scandit logo shown on the view.

logoAnchor
logoAnchor?: Anchor

Added in version 8.7.0

Where the Scandit logo is anchored in the view.

torchControlPosition
torchControlPosition?: Anchor

Added in version 8.7.0

Position of the torch control button. Only Anchor.TopLeft, Anchor.TopRight, Anchor.BottomLeft and Anchor.BottomRight are supported; any other value falls back to Anchor.TopLeft.

recognizedBrush
recognizedBrush?: Brush | null

Added in version 8.7.0

Brush applied to recognized tracked barcodes when BarcodeCountAioViewListener.brushForRecognizedBarcode() is not supplied. With a capture list set, it applies to recognized barcodes that are part of the list. Set it to null to hide all tracked barcodes. Defaults to a yellow brush. Used only with the BarcodeCountViewStyle.Dot style.

notInListBrush
notInListBrush?: Brush | null

Added in version 8.7.0

Brush applied to recognized tracked barcodes that are not part of the capture list, when BarcodeCountAioViewListener.brushForRecognizedBarcodeNotInList() is not supplied. Unused when no capture list is set. Set it to null to hide those barcodes. Defaults to a red brush. Used only with the BarcodeCountViewStyle.Dot style.

acceptedBrush
acceptedBrush?: Brush | null

Added in version 8.7.0

Brush applied to accepted tracked barcodes when BarcodeCountAioViewListener.brushForAcceptedBarcode() is not supplied. Set it to null to hide all accepted barcodes. Defaults to a green brush. Used only with the BarcodeCountViewStyle.Dot style.

rejectedBrush
rejectedBrush?: Brush | null

Added in version 8.7.0

Brush applied to rejected tracked barcodes when BarcodeCountAioViewListener.brushForRejectedBarcode() is not supplied. Set it to null to hide all rejected barcodes. Defaults to a red brush. Used only with the BarcodeCountViewStyle.Dot style.

filterSettings
filterSettings?: BarcodeFilterHighlightSettings | null

Added in version 8.7.0

Settings for the highlights of filtered barcodes.

tapToUncountEnabled
tapToUncountEnabled?: boolean

Added in version 8.7.0

Whether items can be uncounted by tapping their highlights. Defaults to false.

hardwareTriggerEnabled
hardwareTriggerEnabled?: boolean

Added in version 8.7.0

Whether the view reacts to presses of the volume button.

barcodeNotInListActionSettings
barcodeNotInListActionSettings?: BarcodeCountNotInListActionSettings

Added in version 8.7.0

Settings for the actions offered for barcodes that are not in the capture list.

listButtonAccessibilityHint
listButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the list button. Defaults to “List button”.

listButtonAccessibilityLabel
listButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the list button. Defaults to “List button”.

listButtonContentDescription
listButtonContentDescription?: string

Added in version 8.7.0

Content description for the list button. Defaults to “List button”.

exitButtonAccessibilityHint
exitButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the exit button. Defaults to “Exit button”.

exitButtonAccessibilityLabel
exitButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the exit button. Defaults to “Exit button”.

exitButtonContentDescription
exitButtonContentDescription?: string

Added in version 8.7.0

Content description for the exit button. Defaults to “Exit button”.

shutterButtonAccessibilityHint
shutterButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the shutter button. Defaults to “Shutter button”.

shutterButtonAccessibilityLabel
shutterButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the shutter button. Defaults to “Shutter button”.

shutterButtonContentDescription
shutterButtonContentDescription?: string

Added in version 8.7.0

Content description for the shutter button. Defaults to “Shutter button”.

floatingShutterButtonAccessibilityHint
floatingShutterButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the floating shutter button. Defaults to “Floating shutter button”.

floatingShutterButtonAccessibilityLabel
floatingShutterButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the floating shutter button. Defaults to “Floating shutter button”.

floatingShutterButtonContentDescription
floatingShutterButtonContentDescription?: string

Added in version 8.7.0

Content description for the floating shutter button. Defaults to “Floating shutter button”.

clearHighlightsButtonAccessibilityHint
clearHighlightsButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the clear highlights button. Defaults to “Clear highlights button”.

clearHighlightsButtonAccessibilityLabel
clearHighlightsButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the clear highlights button. Defaults to “Clear highlights button”.

clearHighlightsButtonContentDescription
clearHighlightsButtonContentDescription?: string

Added in version 8.7.0

Content description for the clear highlights button. Defaults to “Clear highlights button”.

singleScanButtonAccessibilityHint
singleScanButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the single scan button. Defaults to “Single scan button”.

singleScanButtonAccessibilityLabel
singleScanButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the single scan button. Defaults to “Single scan button”.

singleScanButtonContentDescription
singleScanButtonContentDescription?: string

Added in version 8.7.0

Content description for the single scan button. Defaults to “Single scan button”.

statusModeButtonAccessibilityHint
statusModeButtonAccessibilityHint?: string

Added in version 8.7.0

Accessibility hint for the status mode button. Defaults to “Status mode button”.

statusModeButtonAccessibilityLabel
statusModeButtonAccessibilityLabel?: string

Added in version 8.7.0

Accessibility label for the single status mode button. Defaults to “Status mode button”.

statusModeButtonContentDescription
statusModeButtonContentDescription?: string

Added in version 8.7.0

Content description for the status mode button. Defaults to “Status mode button”.

clearHighlightsButtonText
clearHighlightsButtonText?: string

Added in version 8.7.0

Text of the clear button label provided by the view. Defaults to “Clear screen”.

exitButtonText
exitButtonText?: string

Added in version 8.7.0

Text of the exit button label provided by the view. Defaults to “Finish”.

textForTapShutterToScanHint
textForTapShutterToScanHint?: string

Added in version 8.7.0

Text of the hint suggesting to tap the shutter button. Defaults to “Tap shutter to scan items”.

textForScanningHint
textForScanningHint?: string

Added in version 8.7.0

Text of the hint displayed while scanning is in progress. Defaults to “Scanning”.

textForMoveCloserAndRescanHint
textForMoveCloserAndRescanHint?: string

Added in version 8.7.0

Text of the hint displayed when the camera should be moved closer to rescan. Defaults to “Move closer and tap shutter”.

textForMoveFurtherAndRescanHint
textForMoveFurtherAndRescanHint?: string

Added in version 8.7.0

Text of the hint displayed when the camera should be moved further away to rescan. Defaults to “Step back and tap shutter”.

textForBarcodesNotInListDetectedHint
textForBarcodesNotInListDetectedHint?: string

Added in version 8.7.0

Text of the hint displayed when a barcode not in list is scanned. Defaults to “Wrong barcodes detected!”.

textForScreenCleanedUpHint
textForScreenCleanedUpHint?: string

Added in version 8.7.0

Text of the hint displayed when the screen is cleaned up. Defaults to “Screen cleaned up. All items saved.”.

textForClusteringGestureHint
textForClusteringGestureHint?: string

Added in version 8.7.0

Text of the hint suggesting gestures to form clusters. Shown only when BarcodeCountSettings.clusteringMode is ClusteringMode.Manual or ClusteringMode.AutoWithManualCorrection. Defaults to “Swipe or circle codes to group together.”.

textForTapToUncountHint
textForTapToUncountHint?: string

Added in version 8.7.0

Text of the hint displayed when the user deselects an item. Defaults to “Barcode removed”.

mappingFlowSettings
mappingFlowSettings?: BarcodeCountMappingFlowSettings

Added in version 8.7.0

Settings for the mapping flow, which pairs each counted barcode with a location.

style
style?: StyleProp<ViewStyle>

Added in version 8.7.0

Style applied to the view, defaulting to { flex: 1 }. This is the only React Native View prop the component forwards; it renders its own native view and passes nothing else through.

children
children?: ReactNode

Added in version 8.7.0

Content rendered on top of the scanning UI.

BarcodeCountAioViewHandle
interface BarcodeCountAioViewHandle

Added in version 8.7.0

Imperative operations on a BarcodeCountAioView, reached through a ref on the component.

reset()
reset(): Promise<void>

Added in version 8.7.0

Resets the session, clearing the history of tracked and unscanned barcodes.

clearHighlights()
clearHighlights(): Promise<void>

Added in version 8.7.0

Clears all currently shown barcode highlights. Only affects rendering; detected barcodes remain in the BarcodeCountSession.

setToolbarSettings(settings)
setToolbarSettings(settings: BarcodeCountToolbarSettings): void

Added in version 8.7.0

Applies toolbar text and accessibility overrides. The declarative equivalent is BarcodeCountAioViewProps.toolbarSettings.

setStatusProvider(provider)
setStatusProvider(provider: BarcodeCountStatusProvider): void

Added in version 8.7.0

Sets the provider driving status icons and status mode. The declarative equivalent is BarcodeCountAioViewProps.statusProvider.

setBrushForRecognizedBarcode(trackedBarcode, brush)
setBrushForRecognizedBarcode(trackedBarcode: TrackedBarcode,
        brush: Brush | null): Promise<void>

Added in version 8.7.0

Overrides the brush used for a recognized TrackedBarcode. Used only with the BarcodeCountViewStyle.Dot style.

setBrushForRecognizedBarcodeNotInList(trackedBarcode, brush)
setBrushForRecognizedBarcodeNotInList(trackedBarcode: TrackedBarcode,
        brush: Brush | null): Promise<void>

Added in version 8.7.0

Overrides the brush used for a recognized TrackedBarcode that is not in the capture list. Applies only when a capture list is set. Used only with the BarcodeCountViewStyle.Dot style.

setBrushForAcceptedBarcode(trackedBarcode, brush)
setBrushForAcceptedBarcode(trackedBarcode: TrackedBarcode,
        brush: Brush | null): Promise<void>

Added in version 8.7.0

Overrides the brush used for an accepted TrackedBarcode. Used only with the BarcodeCountViewStyle.Dot style.

setBrushForRejectedBarcode(trackedBarcode, brush)
setBrushForRejectedBarcode(trackedBarcode: TrackedBarcode,
        brush: Brush | null): Promise<void>

Added in version 8.7.0

Overrides the brush used for a rejected TrackedBarcode. Used only with the BarcodeCountViewStyle.Dot style.

enableHardwareTrigger(hardwareTriggerKeyCode)
enableHardwareTrigger(hardwareTriggerKeyCode: number | null): Promise<void>

Added in version 8.7.0

Makes the view react to presses of the hardware button with the given key code. Pass null for the default button: the dedicated hardware button on XCover devices, KeyEvent.KEYCODE_VOLUME_DOWN elsewhere.

enable()
enable(): Promise<void>

Added in version 8.7.0

Turns scanning on now: enables the mode and turns the camera on. Automatic navigation and application-state handling may subsequently turn it off again.

disable()
disable(): Promise<void>

Added in version 8.7.0

Turns scanning off now: disables the mode and turns the camera off.

BarcodeCountAioUiListener
interface BarcodeCountAioUiListener

Added in version 8.7.0

Callbacks for taps on the view’s own buttons. Set it through BarcodeCountAioViewProps.uiListener.

The callbacks correspond to the BarcodeCountViewUiListener methods, without the view argument.

didTapListButton(snapshot)
didTapListButton?(snapshot: BarcodeCountSessionSnapshot | null): void

Added in version 8.7.0

Called when the list button is tapped, with a BarcodeCountSessionSnapshot of the current session.

didTapExitButton(snapshot)
didTapExitButton?(snapshot: BarcodeCountSessionSnapshot | null): void

Added in version 8.7.0

Called when the exit button is tapped, with a BarcodeCountSessionSnapshot of the current session.

didTapSingleScanButton()
didTapSingleScanButton?(): void

Added in version 8.7.0

Called when the single scan button is tapped. Called from the main thread.

BarcodeCountAioViewListener
interface BarcodeCountAioViewListener

Added in version 8.7.0

Callbacks for per-barcode brushes and taps. Set it through BarcodeCountAioViewProps.listener.

The callbacks correspond to the BarcodeCountViewListener methods, without the view argument.

brushForRecognizedBarcode(trackedBarcode)
brushForRecognizedBarcode?(trackedBarcode: TrackedBarcode): Brush | null

Added in version 8.7.0

Returns the brush to draw for a recognized barcode, or null to draw nothing.

brushForRecognizedBarcodeNotInList(trackedBarcode)
brushForRecognizedBarcodeNotInList?(trackedBarcode: TrackedBarcode): Brush | null

Added in version 8.7.0

Returns the brush to draw for a recognized barcode that is not in the capture list, or null to draw nothing.

brushForAcceptedBarcode(trackedBarcode)
brushForAcceptedBarcode?(trackedBarcode: TrackedBarcode): Brush | null

Added in version 8.7.0

Returns the brush to draw for an accepted barcode, or null to draw nothing.

brushForRejectedBarcode(trackedBarcode)
brushForRejectedBarcode?(trackedBarcode: TrackedBarcode): Brush | null

Added in version 8.7.0

Returns the brush to draw for a rejected barcode, or null to draw nothing.

didTapRecognizedBarcode(trackedBarcode)
didTapRecognizedBarcode?(trackedBarcode: TrackedBarcode): void

Added in version 8.7.0

Called when a recognized barcode is tapped.

didTapFilteredBarcode(filteredBarcode)
didTapFilteredBarcode?(filteredBarcode: TrackedBarcode): void

Added in version 8.7.0

Called when a filtered-out barcode is tapped.

didTapRecognizedBarcodeNotInList(trackedBarcode)
didTapRecognizedBarcodeNotInList?(trackedBarcode: TrackedBarcode): void

Added in version 8.7.0

Called when a recognized barcode that is not in the capture list is tapped.

didTapAcceptedBarcode(trackedBarcode)
didTapAcceptedBarcode?(trackedBarcode: TrackedBarcode): void

Added in version 8.7.0

Called when an accepted barcode is tapped.

didTapRejectedBarcode(trackedBarcode)
didTapRejectedBarcode?(trackedBarcode: TrackedBarcode): void

Added in version 8.7.0

Called when a rejected barcode is tapped.

didTapCluster(cluster)
didTapCluster?(cluster: Cluster): void

Added in version 8.7.0

Called when a cluster of barcodes is tapped.

didCompleteCaptureList()
didCompleteCaptureList?(): void

Added in version 8.7.0

Called when every barcode in the capture list has been counted.