Label Capture Basic Overlay Listener

Defined in package com.scandit.datacapture.label.ui.overlay

LabelCaptureBasicOverlayListener
interface LabelCaptureBasicOverlayListener

Added in version 6.0.0

LabelCaptureBasicOverlayListener can be implemented to customize the visual appearance of highlighted labels and their fields in the basic overlay. When label capture identifies a new field, or when the LabelField.state property changes, brushForField() is called to determine the brush of the field.

brushForField(overlay, field, label)
@Nullable Brush brushForField(@NonNull LabelCaptureBasicOverlay overlay,
        @NonNull LabelField field,
        @NonNull CapturedLabel label)

Added in version 6.0.0

Called to determine the visual style for a specific field when its state changes. This method allows you to provide custom styling based on field content, validation status, or other contextual information.

The method is called when a field is first detected, when its state changes (e.g., from predicted to captured), or when field data is updated. Return null to use the default brush for the field’s current state. The returned brush can be overridden by explicit calls to LabelCaptureBasicOverlay.setBrushForField().

brushForLabel(overlay, label)
@Nullable Brush brushForLabel(@NonNull LabelCaptureBasicOverlay overlay,
        @NonNull CapturedLabel label)

Added in version 6.0.0

Called to determine the visual style for a label when any of its fields change state or data. This method allows you to provide custom styling for entire labels based on their completion status, validation results, or other contextual information.

The method is called when any field within the label changes state or when field data is updated. Return null to use the default label brush. The returned brush can be overridden by explicit calls to LabelCaptureBasicOverlay.setBrushForLabel().

onLabelTapped(overlay, label)
void onLabelTapped(@NonNull LabelCaptureBasicOverlay overlay,
        @NonNull CapturedLabel label)

Added in version 6.4.0

Called when a user taps on a captured label in the overlay. This method allows you to handle user interactions with labels, such as showing detailed information, triggering validation flows, or providing additional options.

This method is called from the main thread, making it safe to perform UI operations directly.