Barcode Count View

Defined in package com.scandit.datacapture.barcode.count.ui.view

BarcodeCountViewStyle

Added in version 6.15.0

The style of the BarcodeCountView

ICON

Added in version 6.15.0

Style that draws the highlights as icons and adds an animation for when a code newly appears.

DOT

Added in version 6.15.0

Style that draws the highlights as a dot and adds an animation for when a code newly appears.

BarcodeCountView
class BarcodeCountView : RelativeLayout

Added in version 6.15.0

BarcodeCount comes with a ready-to-use UI. Add BarcodeCountView to the view hierarchy. Please note that this view should be presented full screen.

newInstance(context, dataCaptureContext, mode)
static @NonNull BarcodeCountView newInstance(@NonNull Context context,
        @Nullable DataCaptureContext dataCaptureContext,
        @NonNull BarcodeCount mode)

Added in version 6.15.0

Constructs a new barcode count view.

newInstance(context, dataCaptureContext, mode, style)
static @NonNull BarcodeCountView newInstance(@NonNull Context context,
        @Nullable DataCaptureContext dataCaptureContext,
        @NonNull BarcodeCount mode,
        BarcodeCountViewStyle style)

Added in version 6.15.0

Constructs a new barcode count view.

newInstance(context, dataCaptureView, mode)
static @NonNull BarcodeCountView newInstance(@NonNull Context context,
        @NonNull DataCaptureView dataCaptureView,
        @NonNull BarcodeCount mode)

Added in version 6.15.0

Constructs a new barcode count view. This constructor method should only be used in special cases, and its use is not recommended.

newInstance(context, dataCaptureView, mode, style)
static @NonNull BarcodeCountView newInstance(@NonNull Context context,
        @NonNull DataCaptureView dataCaptureView,
        @NonNull BarcodeCount mode,
        BarcodeCountViewStyle style)

Added in version 6.15.0

Constructs a new barcode count view. This constructor method should only be used in special cases, and its use is not recommended.

shouldShowUserGuidanceView
boolean getShouldShowUserGuidanceView()
void setShouldShowUserGuidanceView(boolean value)

Added in version 6.15.0

When set to true, user guidance and the loading view will be shown to the user. 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.

By default this property is true.

shouldShowListProgressBar
boolean getShouldShowListProgressBar()
void setShouldShowListProgressBar(boolean value)

Added in version 6.24.0

When set to true, a progress bar will be shown to the user when a capture list has been set using BarcodeCount.setBarcodeCountCaptureList(), indicating how many of the barcodes in the list have been scanned.

By default this property is true.

shouldShowListButton
boolean getShouldShowListButton()
void setShouldShowListButton(boolean value)

Added in version 6.15.0

When set to true, a list button will be shown to the user in the lower left hand corner of the screen. When tapped, this button will freeze the mode unless shouldDisableModeOnExitButtonTapped is set to false. This button triggers a call to BarcodeCountViewUiListener.onListButtonTapped().

By default this property is true.

shouldShowExitButton
boolean getShouldShowExitButton()
void setShouldShowExitButton(boolean value)

Added in version 6.15.0

When set to true, an exit button will be shown in the lower right hand corner of the screen. The behavior for this button is left entirely to the developer, and does nothing by default. When clicked, this button triggers a call to BarcodeCountViewUiListener.onExitButtonTapped().

By default this property is true.

shouldShowShutterButton
boolean getShouldShowShutterButton()
void setShouldShowShutterButton(boolean value)

Added in version 6.15.0

When set to true, a shutter button will be shown to the user centered in the bottom of the screen. This button triggers the processing of the current video feed. The same functionality can be triggered by calling BarcodeCount.startScanningPhase().

By default this property is true.

shouldShowHints
boolean getShouldShowHints()
void setShouldShowHints(boolean value)

Added in version 6.15.0

When set to true, this view will show some messages about currently scanned barcodes.

By default this property is true.

shouldShowClearHighlightsButton
boolean getShouldShowClearHighlightsButton()
void setShouldShowClearHighlightsButton(boolean value)

Added in version 6.15.0

When set to true, a button will be shown above the default shutter button. This button clears all currently shown barcodes highlights. The same functionality can be triggered by calling clearHighlights().

By default this property is false.

shouldShowSingleScanButton
boolean getShouldShowSingleScanButton()
void setShouldShowSingleScanButton(boolean value)

Added in version 6.16.0

When set to true, a button will be shown to the user in the lower left corner of the preview. The behavior for this button is left entirely to the developer, and does nothing by default. When clicked, this button triggers a call to BarcodeCountViewUiListener.onSingleScanButtonTapped().

By default this property is false.

shouldShowStatusModeButton
boolean getShouldShowStatusModeButton()
void setShouldShowStatusModeButton(boolean value)

Added in version 6.17.0

When set to true, a button will be shown to the user in the lower right corner of the preview. This button toggles “status mode”, in which the normal barcode highlights will be replaced by status indicators for each barcode. The status for each barcode must be provided via a BarcodeCountStatusProvider previously set with setStatusProvider(). If no BarcodeCountStatusProvider is set, clicking this button has no effect.

By default this property is false.

Note

The Barcode Count status mode API is still in beta and may change in future versions of Scandit Data Capture SDK.

shouldShowFloatingShutterButton
boolean getShouldShowFloatingShutterButton()
void setShouldShowFloatingShutterButton(boolean value)

Added in version 6.15.0

When set to true, a floating shutter button will be visible on screen. This button can be dragged to any position and, when tapped, will trigger the processing of the current video feed.

By default this property is false.

shouldShowToolbar
boolean getShouldShowToolbar()
void setShouldShowToolbar(boolean value)

Added in version 6.16.0

When set to true, a collapsable toolbar will be visible at the top of the preview. This toolbar contains a set of convenience buttons for easy preference setting during scanning.

By default this property is true.

shouldDisableModeOnExitButtonTapped
boolean getShouldDisableModeOnExitButtonTapped()
void setShouldDisableModeOnExitButtonTapped(
        boolean value)

Added in version 6.17.0

When set to true, the mode will disable automatically when the default exit button is tapped.

By default this property is true.

setToolbarSettings(settings)
void setToolbarSettings(@NonNull BarcodeCountToolbarSettings settings)

Added in version 6.16.0

Pass an instance of BarcodeCountToolbarSettings to configure the text and accessibility options for the toolbar.

setStatusProvider(provider)
void setStatusProvider(@NonNull BarcodeCountStatusProvider provider)

Added in version 6.17.0

Sets a BarcodeCountStatusProvider for this view. This provider will be queried when the “status mode” button is clicked.

Note

The Barcode Count status mode API is still in beta and may change in future versions of Scandit Data Capture SDK.

listener
@Nullable BarcodeCountViewListener getListener()
void setListener(@Nullable BarcodeCountViewListener value)

Added in version 6.15.0

The listener which is called whenever a new TrackedBarcode is newly tracked or newly recognized.

Note

Using this listener requires the MatrixScan AR add-on.

uiListener
@Nullable BarcodeCountViewUiListener getUiListener()
void setUiListener(@Nullable BarcodeCountViewUiListener value)

Added in version 6.15.0

The listener which is called whenever the exit or list button of the view did receive a tap.

Note

Using this listener requires the MatrixScan AR add-on.

defaultRecognizedBrush()
static @NonNull Brush defaultRecognizedBrush()

Added in version 6.15.0

Returns the default brush to use for a recognized barcode. When setting a BarcodeCountCaptureList to the mode, this brush will be used for recognized barcodes that are part of the target list. Only used when setting the view style to BarcodeCountViewStyle.DOT.

defaultUnrecognizedBrush()
static @NonNull Brush defaultUnrecognizedBrush()

Added in version 6.15.0

Returns the default brush to use for an unrecognized barcode. Only used when setting the view style to BarcodeCountViewStyle.DOT.

defaultNotInListBrush()
static @NonNull Brush defaultNotInListBrush()

Added in version 6.15.0

Returns the default brush to use for a recognized barcode that’s not part of the target BarcodeCountCaptureList. Only used when setting the view style to BarcodeCountViewStyle.DOT.

recognizedBrush
@Nullable Brush getRecognizedBrush()
void setRecognizedBrush(@Nullable Brush value)

Added in version 6.15.0

The brush applied to recognized tracked barcodes if BarcodeCountViewListener is not implemented. When setting a BarcodeCountCaptureList to the mode, this brush will be used for recognized barcodes that are part of the target list. Setting this brush to null hides all tracked barcodes.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

unrecognizedBrush
@Nullable Brush getUnrecognizedBrush()
void setUnrecognizedBrush(@Nullable Brush value)

Added in version 6.15.0

The brush applied to unrecognized tracked barcodes if BarcodeCountViewListener is not implemented. Setting this brush to null hides all tracked barcodes.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

notInListBrush
@Nullable Brush getNotInListBrush()
void setNotInListBrush(@Nullable Brush value)

Added in version 6.15.0

The brush applied to recognized tracked barcodes that are not part of the target BarcodeCountCaptureList, and only if BarcodeCountViewListener is not implemented. When BarcodeCountCaptureList is not set, this method will never be called. Setting this brush to null hides all tracked barcodes.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

shouldShowScanAreaGuides
boolean getShouldShowScanAreaGuides()
void setShouldShowScanAreaGuides(boolean value)

Added in version 6.15.0

When set to true, this view will visualize the active scan area used for BarcodeCount. This is useful to check margins defined on the DataCaptureView are set correctly. This property is meant for debugging during development and is not intended for use in production.

By default this property is false.

style
BarcodeCountViewStyle getStyle()

Added in version 6.15.0

The view style. Defaults to BarcodeCountViewStyle.DOT.

setStatusModeButtonContentDescription(text)
void setStatusModeButtonContentDescription(
        @NonNull String text)

Added in version 6.17.0

Use this method to modify the content description for the status mode button provided by the view.

getStatusModeButtonContentDescription()
@NonNull String getStatusModeButtonContentDescription()

Added in version 6.17.0

Returns the content description for the status mode button provided by the view.

setClearHighlightsButtonText(text)
void setClearHighlightsButtonText(@NonNull String text)

Added in version 6.15.0

Use this method to modify the text of the clear button label provided by the view.

getClearHighlightsButtonText()
@NonNull String getClearHighlightsButtonText()

Added in version 6.17.0

Returns the text of the clear button label provided by the view.

setListButtonContentDescription(text)
void setListButtonContentDescription(@NonNull String text)

Added in version 6.15.0

Use this method to modify the content description for the list button provided by the view.

getListButtonContentDescription()
@NonNull String getListButtonContentDescription()

Added in version 6.17.0

Returns the content description for the list button provided by the view.

setExitButtonContentDescription(text)
void setExitButtonContentDescription(@NonNull String text)

Added in version 6.15.0

Use this method to modify the content description for the exit button provided by the view.

getExitButtonContentDescription()
@NonNull String getExitButtonContentDescription()

Added in version 6.17.0

Returns the content description for the exit button provided by the view.

setShutterButtonContentDescription(text)
void setShutterButtonContentDescription(@NonNull String text)

Added in version 6.15.0

Use this method to modify the content description for the shutter button provided by the view.

getShutterButtonContentDescription()
@NonNull String getShutterButtonContentDescription()

Added in version 6.17.0

Returns the content description for the shutter button provided by the view.

setClearHighlightsButtonContentDescription(text)
void setClearHighlightsButtonContentDescription(
        @NonNull String text)

Added in version 6.15.0

Use this method to modify the content description for the “clear highlights” button provided by the view.

getClearHighlightsButtonContentDescription()
@NonNull String getClearHighlightsButtonContentDescription()

Added in version 6.17.0

Returns the content description for the “clear highlights” button provided by the view.

setSingleScanButtonContentDescription(text)
void setSingleScanButtonContentDescription(
        @NonNull String text)

Added in version 6.16.0

Use this method to modify the content description for the “single scan” button provided by the view.

getSingleScanButtonContentDescription()
@NonNull String getSingleScanButtonContentDescription()

Added in version 6.17.0

Returns the content description for the “single scan” button provided by the view.

setFloatingShutterButtonContentDescription(text)
void setFloatingShutterButtonContentDescription(
        @NonNull String text)

Added in version 6.15.0

Use this method to modify the content description for the floating shutter button provided by the view.

getFloatingShutterButtonContentDescription()
@NonNull String getFloatingShutterButtonContentDescription()

Added in version 6.17.0

Returns the content description for the floating shutter button provided by the view.

setTextForUnrecognizedBarcodesDetectedHint(text)
void setTextForUnrecognizedBarcodesDetectedHint(
        @NonNull String text)

Added in version 6.15.0

Sets the text of the hint displayed when one or more unrecognized barcodes are detected.

getTextForUnrecognizedBarcodesDetectedHint()
@NonNull String getTextForUnrecognizedBarcodesDetectedHint()

Added in version 6.17.0

Returns the text of the hint displayed when one or more unrecognized barcodes are detected.

setTextForTapShutterToScanHint(text)
void setTextForTapShutterToScanHint(@NonNull String text)

Added in version 6.15.0

Sets the text of the hint which suggests to tap the shutter button.

getTextForTapShutterToScanHint()
@NonNull String getTextForTapShutterToScanHint()

Added in version 6.17.0

Returns the text of the hint which suggests to tap the shutter button.

setTextForScanningHint(text)
void setTextForScanningHint(@NonNull String text)

Added in version 6.15.0

Sets the text of the hint displayed while scanning is in progress.

getTextForScanningHint()
@NonNull String getTextForScanningHint()

Added in version 6.17.0

Returns the text of the hint displayed while scanning is in progress.

setTextForMoveCloserAndRescanHint(text)
void setTextForMoveCloserAndRescanHint(@NonNull String text)

Added in version 6.15.0

Sets the text of the hint displayed when camera should be moved closer to rescan.

getTextForMoveCloserAndRescanHint()
@NonNull String getTextForMoveCloserAndRescanHint()

Added in version 6.17.0

Returns the text of the hint displayed when camera should be moved closer to rescan.

setTextForMoveFurtherAndRescanHint(text)
void setTextForMoveFurtherAndRescanHint(@NonNull String text)

Added in version 6.15.0

Sets the text of the hint displayed when camera should be further away to rescan.

getTextForMoveFurtherAndRescanHint()
@NonNull String getTextForMoveFurtherAndRescanHint()

Added in version 6.17.0

Returns the text of the hint displayed when camera should be further away to rescan.

setTextForBarcodesNotInListDetectedHint(text)
void setTextForBarcodesNotInListDetectedHint(
        @NonNull String text)

Added in version 6.23.0

Sets the text of the hint displayed when a barcode not in list is scanned.

getTextForBarcodesNotInListDetectedHint()
@NonNull String getTextForBarcodesNotInListDetectedHint()

Added in version 6.23.0

Returns the text of the hint displayed when a barcode not in list is scanned.

setExitButtonText(text)
void setExitButtonText(@NonNull String text)

Added in version 6.15.0

Use this method to modify the text of the exit button label provided by the view.

getExitButtonText()
@NonNull String getExitButtonText()

Added in version 6.17.0

Returns the text of the exit button label provided by the view.

filterSettings
@Nullable BarcodeFilterHighlightSettings getFilterSettings()
void setFilterSettings(@Nullable BarcodeFilterHighlightSettings value)

Added in version 6.15.0

Use this property to access or modify the current view settings for barcode filtering.

clearHighlights()
void clearHighlights()

Added in version 6.15.0

Clear all currently shown barcodes highlights. This only affects screen rendering, and all detected barcodes will still be available in the BarcodeCountSession.

setBrushForRecognizedBarcode(barcode, brush)
void setBrushForRecognizedBarcode(@NonNull TrackedBarcode barcode,
        @NonNull Brush brush)

Added in version 6.18.0

Set a Brush to be used for a particular recognized TrackedBarcode. This will override any other applicable brush for this particular barcode.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

setBrushForUnrecognizedBarcode(barcode, brush)
void setBrushForUnrecognizedBarcode(@NonNull TrackedBarcode barcode,
        @NonNull Brush brush)

Added in version 6.18.0

Set a Brush to be used for a particular unrecognized TrackedBarcode. This will override any other applicable brush for this particular barcode.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

setBrushForRecognizedBarcodeNotInList(barcode, brush)
void setBrushForRecognizedBarcodeNotInList(
        @NonNull TrackedBarcode barcode,
        @NonNull Brush brush)

Added in version 6.18.0

Set a Brush to be used for a particular recognized TrackedBarcode that doesn’t belong to the capture list. This will only be applicable when using a capture list, and will override any other applicable brush for this particular barcode.

Used only when the view uses the BarcodeCountViewStyle.DOT style.

enableHardwareTrigger(hardwareTriggerKeyCode)
void enableHardwareTrigger(@Nullable Integer hardwareTriggerKeyCode)

Added in version 6.23.0

Enables the BarcodeCountView to react to clicks on the hardware button specified in hardwareTriggerKeyCode. Pass a null value to use the default button (The default button will be the dedicated HW button on XCover devices, and KeyEvent.KEYCODE_VOLUME_DOWN for other devices).

Note

This feature is only available on devices with api >= 28. Whether a device supports this can be checked at runtime with the hardwareTriggerSupported flag.

hardwareTriggerSupported
boolean getHardwareTriggerSupported()

Added in version 6.23.0

Returns whether the device supports listening for hardware button events. This is true for devices with api >= 28.

tapToUncountEnabled
boolean getTapToUncountEnabled()
void setTapToUncountEnabled(boolean value)

Added in version 6.25.0

Enable this feature to be able to deselect items by tapping on the highlights.

By default this property is false.

setTextForTapToUncountHint(text)
void setTextForTapToUncountHint(@NonNull String text)

Added in version 6.25.0

Sets the text of the hint displayed when the user deselects an item.

getTextForTapToUncountHint()
@NonNull String getTextForTapToUncountHint()

Added in version 6.25.0

Returns the text of the hint displayed when the user deselects an item.

shouldShowTorchControl
boolean getShouldShowTorchControl()
void setShouldShowTorchControl(boolean value)

Added in version 6.26.0

Indicates whether the torch control button should be shown to the user.

Default is false.

torchControlPosition
Anchor getTorchControlPosition()
void setTorchControlPosition(Anchor value)

Added in version 6.26.0

Updates the position of the torch control button.

Only Anchor.TOP_LEFT, Anchor.TOP_RIGHT, Anchor.BOTTOM_LEFT and Anchor.BOTTOM_RIGHT, are supported.

Any other value will default to Anchor.TOP_LEFT.