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 BarcodeDetectorFrameHandler, 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 initDetectionBehavior (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 IBarcodeScannerViewController
viewController
private final IBarcodeScannerFinderViewController
finderViewController
private final IBarcodeScannerViewCameraConfiguration
cameraConfiguration
private final IBarcodeScannerSelectionOverlayController
selectionOverlayController
-
Constructor Summary
Constructors Constructor Description BarcodeScannerView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description IBarcodeScannerViewController
getViewController()
Use this object to control the state or the behavior of the IBarcodeScannerView IBarcodeScannerFinderViewController
getFinderViewController()
Use this object to control the state or the behavior of the Finder inside IBarcodeScannerViewCameraConfiguration
getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside IBarcodeScannerSelectionOverlayController
getSelectionOverlayController()
Use this object to control the state or the behavior of the selection overlay layer Unit
initCamera(CameraUiSettings cameraUiSettings)
This must be called in the onCreate of the Activity Unit
initDetectionBehavior(ScanbotBarcodeDetector barcodeDetector, BarcodeDetectorFrameHandler.ResultHandler resultHandler, IBarcodeScannerViewCallback callback)
This should be called as soon as you have an instance of the Contour detector. Boolean
usesCameraX()
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
-
initDetectionBehavior
Unit initDetectionBehavior(ScanbotBarcodeDetector barcodeDetector, BarcodeDetectorFrameHandler.ResultHandler resultHandler, IBarcodeScannerViewCallback callback)
This should be called as soon as you have an instance of the Contour detector. 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.
-
-
-
-