Barcode AR Responsive Annotation
Defined in package com.scandit.datacapture.barcode.ar.ui
- BarcodeArResponsiveAnnotation
class BarcodeArResponsiveAnnotation : BarcodeArAnnotation
Added in version 7.5.0
Responsive annotations dynamically switch between two different info annotation variations based on the barcode’s size relative to the screen. This allows for different display styles when barcodes appear close-up versus far away in the camera view.
The annotation uses a configurable threshold to determine when to switch between the close-up and far-away variations. When the barcode area as a percentage of the screen area exceeds the threshold, the far-away annotation is displayed. Otherwise, the close-up annotation is shown.
Both the close-up and far-away annotations are BarcodeArInfoAnnotation instances, but either can be set to null to display nothing for that variation.
- BarcodeArResponsiveAnnotation()
BarcodeArResponsiveAnnotation(@NonNull Context context, @NonNull Barcode barcode, @Nullable BarcodeArInfoAnnotation closeUpAnnotation, @Nullable BarcodeArInfoAnnotation farAwayAnnotation)
Added in version 7.5.0
Constructs a new responsive annotation with the given barcode and annotation variations.
- update(barcodeLocation, highlightViewLocation, view)
voidupdate(@NonNull Quadrilateral barcodeLocation, @NonNull Quadrilateral highlightViewLocation, @NonNull View view)Added in version 7.5.0
Called to update the view with barcode location and highlight location. Called from the main thread. This method should not be called directly, it will be invoked automatically when needed.
- createView()
@NonNull View createView()
Added in version 7.5.0
Called once to get the view that will be updated with barcode location in update(). Called from the main thread.
- threshold
floatgetThreshold()voidsetThreshold(floatvalue)Added in version 7.5.0
The threshold (percentage of the barcode area vs screen area) that determines when to display close-up vs far-away annotations.
The value should be between 0.0 and 1.0, where 0.1 represents 10% of the screen area. The default value is 0.05.
Note
The threshold is a class-level property that applies to all instances of BarcodeArResponsiveAnnotation.
- barcode
@NonNull Barcode getBarcode()
Added in version 7.5.0
The barcode instance for the annotation.
- annotationTrigger
BarcodeArAnnotationTrigger getAnnotationTrigger()
voidsetAnnotationTrigger(BarcodeArAnnotationTrigger value)Added in version 7.5.0
The trigger that causes the annotation to be presented. By default is BarcodeArAnnotationTrigger.HIGHLIGHT_TAP_AND_BARCODE_SCAN.