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 Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Unit
attachViewModel(IBarcodeCameraView.ViewModel viewModel)
Unit
attachPermissionViewModel(IPermissionViewModel viewModel)
Unit
setCameraOrientationMode(CameraOrientationMode cameraOrientationMode)
Set camera orientation mode Unit
setCameraModule(CameraModule cameraModule)
Set camera module Unit
setCameraZoomRatio(Float zoomRatio)
Set current zoom ratio ranging from 0.5f to 100f. Unit
setCameraZoomRange(ZoomRange zoomRange)
Set custom available zoom range. Unit
lockMinFocusDistance(Boolean lockMinFocusDistance)
Locks the minimal supported focus distance and disables a continuous focus Unit
setBarcodeHighlightedDelegate(BarcodePolygonsView.BarcodeHighlightDelegate barcodeHighlightDelegate)
Sets the delegate allowing to control which barcodes should be highlighted on the Barcode selection overlay Unit
setSelectionOverlayEnabled(Boolean enabled)
Enables or disables barcode selection overlay layer Unit
setSelectionOverlayPolygonColor(Integer color)
The color of the polygon in the selection overlay. Unit
setSelectionOverlayTextColor(Integer color)
The color of the text in the selection overlay. Unit
setSelectionOverlayTextFormat(BarcodeOverlayTextFormat format)
The color of the text in the selection overlay. Unit
setSelectionOverlayTextContainerColor(Integer color)
The color of the texts background in the selection overlay. Unit
setSelectionOverlayHighlightedPolygonColor(Integer color)
The color of the polygon in the selection overlay, when highlighted. Unit
setSelectionOverlayHighlightedTextColor(Integer color)
The color of the text in the selection overlay, when highlighted. Unit
setSelectionOverlayHighlightedTextContainerColor(Integer color)
The color of the texts background in the selection overlay, when highlighted. Unit
setSuccessfulDetectionInterval(Long detectionIntervalInMs)
Set detection interval between successful frames in milliseconds final Unit
setBarcodeImageGenerationType(BarcodeImageGenerationType barcodeImageGenerationType)
-
-
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 camera module
- Parameters:
cameraModule
- one of the supported modes - CameraModule
-
setCameraZoomRatio
Unit setCameraZoomRatio(Float zoomRatio)
Set current zoom ratio ranging from 0.5f to 100f. Equal to 1f represents 1x zoom ratio. Default value is 1f.
- Parameters:
zoomRatio
- Target zoom ratio
-
setCameraZoomRange
Unit setCameraZoomRange(ZoomRange zoomRange)
Set custom available zoom range. Min value 0.5f and max value 100f. 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
- Parameters:
lockMinFocusDistance
- iftrue
minimal available focus distance will be locked,false
- otherwise Default isfalse
.
-
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.
-
setSuccessfulDetectionInterval
Unit setSuccessfulDetectionInterval(Long detectionIntervalInMs)
Set detection interval between successful frames in milliseconds
- Parameters:
detectionIntervalInMs
- detection interval between successful frames
-
setBarcodeImageGenerationType
final Unit setBarcodeImageGenerationType(BarcodeImageGenerationType barcodeImageGenerationType)
-
-
-
-