Barcode Tracking Basic Overlay

Defined in package com.scandit.datacapture.barcode.tracking.ui.overlay

BarcodeTrackingBasicOverlayStyle

Added in version 6.10.0

The style of the BarcodeTrackingBasicOverlay

LEGACY

Added in version 6.10.0

Legacy style from versions before 6.10.

FRAME

Added in version 6.10.0

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

DOT

Added in version 6.10.0

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

BarcodeTrackingBasicOverlay
class BarcodeTrackingBasicOverlay : DataCaptureOverlay

Added in version 6.0.0

An overlay for SDCDataCaptureView that shows a simple augmentation over each tracked barcode.

To display the augmentations, this overlay must be attached to a DataCaptureView. This may be done either by creating it with newInstance() with a non-null view parameter or by passing this overlay to DataCaptureView.addOverlay().

A user of this class may configure the appearance of the augmentations by implementing BarcodeTrackingBasicOverlayListener or by calling setBrushForTrackedBarcode().

For additional information about using this overlay, refer to Get Started With MatrixScan.

newInstance(mode, view)
static @NonNull BarcodeTrackingBasicOverlay newInstance(
        @NonNull BarcodeTracking mode,
        @Nullable DataCaptureView view)

Added in version 6.0.0

Constructs a new barcode tracking basic overlay for the barcode tracking instance. The overlay is automatically added to the view.

newInstance(mode, view, style)
static @NonNull BarcodeTrackingBasicOverlay newInstance(
        @NonNull BarcodeTracking mode,
        @Nullable DataCaptureView view,
        BarcodeTrackingBasicOverlayStyle style)

Added in version 6.10.0

Constructs a new barcode tracking basic overlay for the barcode tracking instance with the specified style. The overlay is automatically added to the view.

fromJson(mode, jsonData)
static @NonNull BarcodeTrackingBasicOverlay fromJson(
        @NonNull BarcodeTracking mode,
        @NonNull String jsonData)

Added in version 6.0.0

Constructs a new barcode tracking basic overlay with the provided JSON serialization. See Serialization for details.

For the overlay to be displayed on screen, it must be added to a DataCaptureView.

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

Added in version 6.0.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.

DEFAULT_BRUSH
static final @NonNull Brush DEFAULT_BRUSH

Added in version 6.4.0

The default brush applied to recognized tracked barcodes.

Deprecated since version 6.10.1: The defaultBrush of the overlay depends on the style used, there is no unique default brush. Use defaultBrush() instead.

defaultBrush(style)
static Brush defaultBrush(BarcodeTrackingBasicOverlayStyle style)

Added in version 6.10.1

Returns the default brush for the given style.

brush
@Nullable Brush getBrush()
void setBrush(@Nullable Brush value)

Added in version 6.4.0

The brush applied to recognized tracked barcodes if BarcodeTrackingBasicOverlayListener is not implemented. By default the value is set to DEFAULT_BRUSH. Setting this brush to null hides all tracked barcodes, unless setBrushForTrackedBarcode() is called.

defaultBrush
@Nullable Brush getDefaultBrush()
void setDefaultBrush(@Nullable Brush value)

Added in version 6.0.0

The default brush applied to recognized tracked barcodes. This is the brush used if BarcodeTrackingBasicOverlayListener is not implemented. Setting this brush to null hides all tracked barcodes, unless setBrushForTrackedBarcode() is called.

Deprecated since version 6.4.0: Replaced by brush.

setBrushForTrackedBarcode(trackedBarcode, brush)
void setBrushForTrackedBarcode(@NonNull TrackedBarcode trackedBarcode,
        @Nullable Brush brush)

Added in version 6.0.0

The method can be called to change the visualization style of a tracked barcode. This method is thread-safe, it can be called from any thread. If the brush is null, then no visualization will be drawn for the tracked barcode. Additionally, tapping on the barcode will have no effect - the action defined by BarcodeTrackingBasicOverlayListener.onTrackedBarcodeTapped() callback will not be performed.

Note

Using this function requires the MatrixScan AR add-on.

clearTrackedBarcodeBrushes()
void clearTrackedBarcodeBrushes()

Added in version 6.0.0

Clears all currently displayed visualizations for the tracked barcodes.

This only applies to the currently tracked barcodes, the visualizations for the new ones will still appear.

shouldShowScanAreaGuides
boolean getShouldShowScanAreaGuides()
void setShouldShowScanAreaGuides(boolean value)

Added in version 6.0.0

When set to true, this overlay will visualize the active scan area used for BarcodeTracking. 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.

updateFromJson(jsonData)
void updateFromJson(@NonNull String jsonData)

Added in version 6.0.0

Updates the overlay according to a JSON serialization. See Serialization for details.

setProperty(name, value)
void setProperty(@NonNull String name,
        @NonNull Object value)

Added in version 6.1.0

Set barcode tracking basic overlay property to the provided value. Use this method to set properties that are not yet part of a stable API. Properties set through this method may or may not be used or change in a future release.

getProperty(name)
@Nullable Object getProperty(@NonNull String name)

Added in version 6.1.0

Retrieves the value of a previously set barcode tracking basic overlay property. In case the property does not exist, null is returned.

style
BarcodeTrackingBasicOverlayStyle getStyle()

Added in version 6.10.0

The overlay style. Defaults to Legacy.