Class BarcodeScanAndCountView
-
- 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.IBarcodeCounterView
public final class BarcodeScanAndCountView extends FrameLayout implements IBarcodeCounterView
A component which allows to quickly integrate a Barcode counting feature into your application. It wraps BarcodeCounterFrameHandler, io.scanbot.sdk.ui.camera.IScanbotCameraView, providing an interface allowing to control appearance and behavior of the component.
To start using it you need to add BarcodeScanAndCountView 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 IBarcodeScanCountViewController.onResume on the viewController in Activity onResume and IBarcodeScanCountViewController.onPause on the viewController in Activity onPause
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<BarcodeItem, Integer>
countedBarcodes
private final IBarcodeScanCountViewController
viewController
private final IBarcodeScanCountViewCameraConfiguration
cameraConfiguration
private final IBarcodeScanCountSelectionOverlayController
counterOverlayController
-
Constructor Summary
Constructors Constructor Description BarcodeScanAndCountView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description final Map<BarcodeItem, Integer>
getCountedBarcodes()
IBarcodeScanCountViewController
getViewController()
Use this object to control the state or the behavior of the IBarcodeCounterView IBarcodeScanCountViewCameraConfiguration
getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside IBarcodeScanCountSelectionOverlayController
getCounterOverlayController()
Use this object to control the state or the behavior of the selection overlay layer Unit
initCamera()
This must be called in the onCreate of the Activity Unit
initDetectionBehavior(ScanbotBarcodeDetector barcodeDetector, IBarcodeScanCountViewCallback callback)
This should be called as soon as you have an instance of the Contour detector. -
-
Constructor Detail
-
BarcodeScanAndCountView
BarcodeScanAndCountView(Context context, AttributeSet attrs)
-
-
Method Detail
-
getCountedBarcodes
final Map<BarcodeItem, Integer> getCountedBarcodes()
-
getViewController
IBarcodeScanCountViewController getViewController()
Use this object to control the state or the behavior of the IBarcodeCounterView
-
getCameraConfiguration
IBarcodeScanCountViewCameraConfiguration getCameraConfiguration()
Use this object to control configuration parameters of the Camera inside
-
getCounterOverlayController
IBarcodeScanCountSelectionOverlayController getCounterOverlayController()
Use this object to control the state or the behavior of the selection overlay layer
-
initCamera
Unit initCamera()
This must be called in the onCreate of the Activity
-
initDetectionBehavior
Unit initDetectionBehavior(ScanbotBarcodeDetector barcodeDetector, IBarcodeScanCountViewCallback 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
-
-
-
-