Barcode AR Responsive Annotation
Defined in package com.scandit.datacapture.barcode.ar.ui
- BarcodeArResponsiveAnnotation
class BarcodeArResponsiveAnnotation : BarcodeArAnnotation
Added in version 8.6.0
Responsive annotations dynamically switch between different info annotation variations based on the barcode’s size relative to the screen. This allows for different display styles as a barcode gets closer to or further from the camera.
Each variation is gated by an area-ratio upper bound (the barcode area as a percentage of the screen area). The variations are evaluated from far to close, and the one whose upper bound is the first at or above the current ratio is displayed.
Each variation is a BarcodeArInfoAnnotation instance, but any can be set to null to display nothing in that range.
- BarcodeArResponsiveAnnotation(barcode, closeUpAnnotation, farAwayAnnotation)
BarcodeArResponsiveAnnotation(barcode: Barcode, closeUpAnnotation: BarcodeArInfoAnnotation?, farAwayAnnotation: BarcodeArInfoAnnotation?)
Added in version 8.6.0
Constructs a new responsive annotation with the given barcode and annotation variations.
- threshold
var BarcodeArResponsiveAnnotation.threshold: Float
Added in version 8.6.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.
- annotationTrigger
var annotationTrigger: BarcodeArAnnotationTrigger
Added in version 8.6.0
The trigger that causes the annotation to be presented. By default is BarcodeArAnnotationTrigger.HIGHLIGHT_TAP_AND_BARCODE_SCAN.
- closeUpAnnotation
val closeUpAnnotation: BarcodeArInfoAnnotation?
Added in version 8.6.0
The annotation displayed when the barcode appears close-up (when the barcode area exceeds the threshold).
Can be null to display nothing for close-up barcodes.
- farAwayAnnotation
val farAwayAnnotation: BarcodeArInfoAnnotation?
Added in version 8.6.0
The annotation displayed when the barcode appears far away (when the barcode area is below or equal to the threshold).
Can be null to display nothing for far-away barcodes.