Barcode AR View

Defined in package com.scandit.datacapture.barcode.ar.ui

BarcodeArViewUiListener
interface BarcodeArViewUiListener

Added in version 7.1.0

onHighlightForBarcodeTapped(barcodeAr, barcode, highlight, highlightView)
fun onHighlightForBarcodeTapped(barcodeAr: BarcodeAr,
        barcode: Barcode,
        highlight: BarcodeArHighlight,
        highlightView: View)

Added in version 7.1.0

Callback method that is called when a barcode highlight is tapped in the view.

BarcodeArView
class BarcodeArView : FrameLayout

Added in version 7.1.0

Barcode AR comes with a ready-to-use UI that allows highlighting barcodes and displaying additional information over them. The BarcodeArView integrates with any app in just a few lines of code.

BarcodeArView(parentView, barcodeAr, dataCaptureContext, settings, cameraSettings)
BarcodeArView(parentView: ViewGroup,
        barcodeAr: BarcodeAr,
        dataCaptureContext: DataCaptureContext,
        settings: BarcodeArViewSettings,
        cameraSettings: CameraSettings?)

Added in version 7.1.0

Creates a new BarcodeArView with the provided mode, viewSettings and cameraSettings.

BarcodeArView(parentView, barcodeAr, dataCaptureContext, settings)
BarcodeArView(parentView: ViewGroup,
        barcodeAr: BarcodeAr,
        dataCaptureContext: DataCaptureContext,
        settings: BarcodeArViewSettings)

Added in version 7.1.0

Creates a new BarcodeArView with the provided mode, viewSettings and default camera settings from BarcodeAr.createRecommendedCameraSettings(). This is equivalent of calling BarcodeArView() with null cameraSettings.

uiListener
var uiListener: BarcodeArViewUiListener?

Added in version 7.1.0

Sets the listener which is called whenever a barcode highlight is tapped in the view.

highlightProvider
var highlightProvider: BarcodeArHighlightProvider?

Added in version 7.1.0

Sets the provider which supplies highlight information for barcodes in the view. If null, a default provider is used, which returns a predefined highlight for each barcode.

annotationProvider
var annotationProvider: BarcodeArAnnotationProvider?

Added in version 7.1.0

Sets the provider which supplies annotation information for barcodes in the view. If null, no annotation will be displayed for any barcode.

shouldShowTorchControl
var shouldShowTorchControl: Boolean

Added in version 7.1.0

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

Default is false.

torchControlPosition
var torchControlPosition: Anchor

Added in version 7.1.0

Updates the position of the torch control button.

Default is Anchor.TOP_LEFT.

shouldShowZoomControl
var shouldShowZoomControl: Boolean

Added in version 7.1.0

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

zoomControlPosition
var zoomControlPosition: Anchor

Added in version 7.1.0

Updates the position of the zoom control button.

Default is Anchor.BOTTOM_RIGHT.

shouldShowCameraSwitchControl
var shouldShowCameraSwitchControl: Boolean

Added in version 7.1.0

Indicates whether the camera switch control button should be shown to the user.

cameraSwitchControlPosition
var cameraSwitchControlPosition: Anchor

Added in version 7.1.0

Updates the position of the camera switch control button.

Default is Anchor.TOP_RIGHT.

start()
fun start()

Added in version 7.1.0

Starts the scanning process.

The scanning process will actually start only if the lifecycle state is resumed, which can be done by calling onResume().

stop()
fun stop()

Added in version 7.1.0

Stops the scanning process.

onPause()
fun onPause()

Added in version 7.1.0

Function to call on Fragment/Activity onPause callback. This will set the BarcodeArView’s lifecycle state to Paused. Scanning only happens when the BarcodeArView is in Resumed state. You have to call this for the correct functioning of the BarcodeArView.

override fun onPause() {
  super.onPause()
  barcodeArView.onPause()
}
onResume()
fun onResume()

Added in version 7.1.0

Function to call on Fragment/Activity onResume callback. This will set the BarcodeArView’s lifecycle state to Resumed. Scanning only happens when the BarcodeArView is in Resumed state. You have to call this for the correct functioning of the BarcodeArView.

override fun onResume() {
  super.onResume()
  barcodeArView.onResume()
}
onDestroy()
fun onDestroy()

Added in version 7.1.0

Function to call on Fragment/Activity onDestroyView callback. This will set the BarcodeArView’s lifecycle state to Destroyed. Scanning only happens when the BarcodeArView is in Resumed state. You have to call this for the correct functioning of the BarcodeArView.

override fun onDestroyView() {
  super.onDestroyView()
  barcodeArView.onDestroy()
}
reset()
fun reset()

Added in version 7.1.0

Clears all highlights and annotations currently visible and calls highlightProvider and annotationProvider to supply new highlights and annotations.

notificationPresenter
val notificationPresenter: NotificationPresenter

Added in version 7.5.0

Returns a NotificationPresenter instance that can be used to present notifications to the user.