Class BarcodeScannerView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource,io.scanbot.sdk.barcode.ui.IBarcodeScannerView
public class BarcodeScannerView extends FrameLayout implements IBarcodeScannerView
A component which allows to quickly integrate a Barcode scanning feature into your application. It wraps BarcodeScannerFrameHandler, io.scanbot.sdk.ui.camera.IScanbotCameraView, io.scanbot.sdk.camera.IFinderView and BarcodeAutoSnappingController providing an interface allowing to control appearance and behavior of the component.
To start using it you need to add BarcodeScannerView into your layout and the call two methods initCamera and initScanningBehavior (see corresponding docs).
If you use a legacy camera (non CameraX - see CameraUiSettings) it is also required to call IBarcodeScannerViewController.onResume on the viewController in Activity onResume and IBarcodeScannerViewController.onPause on the viewController in Activity onPause
-
-
Field Summary
Fields Modifier and Type Field Description private final IBarcodeScannerViewControllerviewControllerprivate final IBarcodeScannerFinderViewControllerfinderViewControllerprivate final IBarcodeScannerViewCameraConfigurationcameraConfigurationprivate final IBarcodeScannerSelectionOverlayControllerselectionOverlayController
-
Constructor Summary
Constructors Constructor Description BarcodeScannerView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description IBarcodeScannerViewControllergetViewController()Use this object to control the state or the behavior of the IBarcodeScannerView IBarcodeScannerFinderViewControllergetFinderViewController()Use this object to control the state or the behavior of the Finder inside IBarcodeScannerViewCameraConfigurationgetCameraConfiguration()Use this object to control configuration parameters of the Camera inside IBarcodeScannerSelectionOverlayControllergetSelectionOverlayController()Use this object to control the state or the behavior of the selection overlay layer UnitinitCamera(CameraUiSettings cameraUiSettings)This must be called in the onCreate of the Activity UnitinitScanningBehavior(BarcodeScanner barcodeScanner, BarcodeScannerFrameHandler.ResultHandler resultHandler, IBarcodeScannerViewCallback callback)This should be called as soon as you have an instance of the BarcodeScanner. BooleanusesCameraX()Get the flag, indicating that the underlying camera view is CameraX-based. -
-
Constructor Detail
-
BarcodeScannerView
BarcodeScannerView(Context context, AttributeSet attrs)
-
-
Method Detail
-
getViewController
IBarcodeScannerViewController getViewController()
Use this object to control the state or the behavior of the IBarcodeScannerView
-
getFinderViewController
IBarcodeScannerFinderViewController getFinderViewController()
Use this object to control the state or the behavior of the Finder inside
-
getCameraConfiguration
IBarcodeScannerViewCameraConfiguration getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside
-
getSelectionOverlayController
IBarcodeScannerSelectionOverlayController getSelectionOverlayController()
Use this object to control the state or the behavior of the selection overlay layer
-
initCamera
Unit initCamera(CameraUiSettings cameraUiSettings)
This must be called in the onCreate of the Activity
-
initScanningBehavior
Unit initScanningBehavior(BarcodeScanner barcodeScanner, BarcodeScannerFrameHandler.ResultHandler resultHandler, IBarcodeScannerViewCallback callback)
This should be called as soon as you have an instance of the BarcodeScanner. It is recommended to call it in onCreate of the Activity
-
usesCameraX
Boolean usesCameraX()
Get the flag, indicating that the underlying camera view is CameraX-based.
-
-
-
-