Class BarcodeCameraView
-
- 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.ui.view.barcode.IBarcodeCameraView
public final class BarcodeCameraView extends FrameLayout implements IBarcodeCameraView
Represents camera view for barcode scanner.
-
-
Constructor Summary
Constructors Constructor Description BarcodeCameraView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description final UnitsetCameraPreviewMode(CameraPreviewMode cameraPreviewMode)UnitattachViewModel(IBarcodeCameraView.ViewModel viewModel)UnitattachPermissionViewModel(IPermissionViewModel viewModel)UnitsetCameraOrientationMode(CameraOrientationMode cameraOrientationMode)Set camera orientation mode. UnitsetCameraModule(CameraModule cameraModule)Set device's camera module to use. UnitsetCameraZoomRatio(Float zoomRatio)Set current zoom ratio ranging from 0.5fto100f.UnitsetCameraZoomRange(ZoomRange zoomRange)Set custom available zoom range. UnitlockMinFocusDistance(Boolean lockMinFocusDistance)Locks the minimal supported focus distance and disables a continuous focus. UnitsetBarcodeHighlightedDelegate(BarcodePolygonsView.BarcodeHighlightDelegate barcodeHighlightDelegate)Sets the delegate allowing to control which barcodes should be highlighted on the Barcode selection overlay. UnitsetSelectionOverlayEnabled(Boolean enabled)Enables or disables barcode selection overlay layer. UnitsetSelectionOverlayPolygonColor(Integer color)The color of the polygon in the selection overlay. UnitsetSelectionOverlayTextColor(Integer color)The color of the text in the selection overlay. UnitsetSelectionOverlayTextFormat(BarcodeOverlayTextFormat format)The color of the text in the selection overlay. UnitsetSelectionOverlayTextContainerColor(Integer color)The color of the texts background in the selection overlay. UnitsetSelectionOverlayHighlightedPolygonColor(Integer color)The color of the polygon in the selection overlay, when highlighted. UnitsetSelectionOverlayHighlightedTextColor(Integer color)The color of the text in the selection overlay, when highlighted. UnitsetSelectionOverlayHighlightedTextContainerColor(Integer color)The color of the texts background in the selection overlay, when highlighted. UnitsetSuccessfulScanningInterval(Long scanningIntervalInMs)Set an interval between successful scanned frames in milliseconds. -
-
Constructor Detail
-
BarcodeCameraView
BarcodeCameraView(Context context, AttributeSet attrs)
-
-
Method Detail
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
-
attachViewModel
Unit attachViewModel(IBarcodeCameraView.ViewModel viewModel)
- Parameters:
viewModel- which will receive callbacks on user interactions.
-
attachPermissionViewModel
Unit attachPermissionViewModel(IPermissionViewModel viewModel)
- Parameters:
viewModel- which will handle permissions.
-
setCameraOrientationMode
Unit setCameraOrientationMode(CameraOrientationMode cameraOrientationMode)
Set camera orientation mode.
- Parameters:
cameraOrientationMode- CameraOrientationMode.LANDSCAPE or CameraOrientationMode.PORTRAIT
-
setCameraModule
Unit setCameraModule(CameraModule cameraModule)
Set device's camera module to use.
- Parameters:
cameraModule- one of the supported modes - CameraModule
-
setCameraZoomRatio
Unit setCameraZoomRatio(Float zoomRatio)
Set current zoom ratio ranging from
0.5fto100f.1frepresents 1x zoom ratio. The default value is1f.- Parameters:
zoomRatio- Target zoom ratio
-
setCameraZoomRange
Unit setCameraZoomRange(ZoomRange zoomRange)
Set custom available zoom range. Min value
0.5fand max value100f. Range 0.5x -> 100x is to become 1x -> 10x if that is what the device supports. Default value is ZoomRange(0.5f, 100f).
-
lockMinFocusDistance
Unit lockMinFocusDistance(Boolean lockMinFocusDistance)
Locks the minimal supported focus distance and disables a continuous focus. The default is
false.- Parameters:
lockMinFocusDistance- iftrue- minimal available focus distance will be locked,false- otherwise
-
setBarcodeHighlightedDelegate
Unit setBarcodeHighlightedDelegate(BarcodePolygonsView.BarcodeHighlightDelegate barcodeHighlightDelegate)
Sets the delegate allowing to control which barcodes should be highlighted on the Barcode selection overlay.
-
setSelectionOverlayEnabled
Unit setSelectionOverlayEnabled(Boolean enabled)
Enables or disables barcode selection overlay layer.
-
setSelectionOverlayPolygonColor
Unit setSelectionOverlayPolygonColor(Integer color)
The color of the polygon in the selection overlay.
-
setSelectionOverlayTextColor
Unit setSelectionOverlayTextColor(Integer color)
The color of the text in the selection overlay.
-
setSelectionOverlayTextFormat
Unit setSelectionOverlayTextFormat(BarcodeOverlayTextFormat format)
The color of the text in the selection overlay.
-
setSelectionOverlayTextContainerColor
Unit setSelectionOverlayTextContainerColor(Integer color)
The color of the texts background in the selection overlay.
-
setSelectionOverlayHighlightedPolygonColor
Unit setSelectionOverlayHighlightedPolygonColor(Integer color)
The color of the polygon in the selection overlay, when highlighted.
-
setSelectionOverlayHighlightedTextColor
Unit setSelectionOverlayHighlightedTextColor(Integer color)
The color of the text in the selection overlay, when highlighted.
-
setSelectionOverlayHighlightedTextContainerColor
Unit setSelectionOverlayHighlightedTextContainerColor(Integer color)
The color of the texts background in the selection overlay, when highlighted.
-
setSuccessfulScanningInterval
Unit setSuccessfulScanningInterval(Long scanningIntervalInMs)
Set an interval between successful scanned frames in milliseconds.
- Parameters:
scanningIntervalInMs- interval between successful scanned frames
-
-
-
-