Class BatchBarcodeScannerConfiguration
-
- All Implemented Interfaces:
public final class BatchBarcodeScannerConfiguration
Class which is used to configure BatchBarcodeScannerActivity. Contains settings indicating views Behaviour, Texts and Appearance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BatchBarcodeScannerConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final BatchBarcodeScannerJsonConfiguration
params
private final BatchBarcodeScannerNativeConfiguration
nativeParams
public final static BatchBarcodeScannerConfiguration.Companion
Companion
-
Constructor Summary
Constructors Constructor Description BatchBarcodeScannerConfiguration()
-
Method Summary
Modifier and Type Method Description final BatchBarcodeScannerJsonConfiguration
getParams()
final BatchBarcodeScannerNativeConfiguration
getNativeParams()
final Unit
setClearButtonTitle(String clearButtonTitle)
Text of the button which clears the list of scanned barcodes. final Unit
setNoBarcodesTitle(String noBarcodesTitle)
Text of the message that there are no barcodes scanned. final Unit
setSubmitButtonTitle(String submitButtonTitle)
Text of the button which finishes the flow. final Unit
setDetailsBackgroundColor(Integer color)
The color of bottom sheet. final Unit
setDetailsPrimaryColor(Integer color)
The color of text elements in bottom sheet. final Unit
setDetailsActionColor(Integer color)
The color of Submit button. final Unit
setBarcodesCountText(String placeholder)
The placeholder for barcodes count text. final Unit
setBarcodesCountTextColor(Integer color)
The color for barcodes count text. final Unit
setFetchingStateText(String text)
The text for the data fetching state of the barcode item in a list. final Unit
setBarcodeFilter(IBarcodeFilter barcodeFilter)
Additional filter to reject or accept barcode scanner results. final Unit
setBarcodeFormatsFilter(List<BarcodeFormat> barcodeFormat)
A list of barcodes that the scanner should recognize. final Unit
setFormattedBarcodeDataMapper(FormattedBarcodeDataMapper dataMapper)
Additional filter to reject or accept barcode scanner results. final Unit
setSuccessfulDetectionInterval(Long detectionIntervalInMs)
Set detection interval between successful frames in milliseconds. final Unit
setEngineMode(EngineMode engineMode)
Allows to set custom EngineMode for the barcode detection EngineMode.NextGen is used by default final Unit
setAcceptedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)
A list of document formats that the scanner should recognize. final Unit
setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. final Unit
setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: PORTRAIT or LANDSCAPE. final Unit
setSuccessBeepEnabled(Boolean successBeepEnabled)
Controls whether to play a beep sound after a successful detection. final Unit
setTopBarBackgroundColor(Integer topBarBackgroundColor)
Background color of the top toolbar. final Unit
setTopBarButtonsColor(Integer topBarButtonsColor)
Color of the titles of all buttons in the top toolbar. final Unit
setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of the inactive flash button in the toolbar. final Unit
setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window. final Unit
setViewFinderEnabled(Boolean viewFinderEnabled)
Set true
to enable showing the area of interest on camera preview.final Unit
setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window. final Unit
setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px. final Unit
setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline. final Unit
setFinderTextHintColor(Integer finderTextHintColor)
Color of the text hint under the finder window. final Unit
setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style. final Unit
setAutoCancelTimeout(Integer seconds)
Sets auto close timer in seconds. final Unit
setCameraZoomRatio(Float zoomRatio)
Set current zoom ratio from 0.5x up to 100x (if supported). final Unit
setCameraZoomRange(ZoomRange zoomRange)
Set custom camera zoom range. final Unit
setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT or others. final Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-In. final Unit
setMinFocusDistanceLock(Boolean lock)
Locks the minimal supported focus distance and disables a continuous focus final Unit
setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button. final Unit
setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button. final Unit
setFinderTextHint(String finderTextHint)
Text hint shown under the finder window. final Unit
setEnableCameraExplanationText(String enableCameraExplanationText)
Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera. final Unit
setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app. final Unit
setAdditionalDetectionParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeDetector to further tweak it's logic. final Unit
setSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration)
Controls the state of the Barcode selection overlay. final Unit
setInitialScanDelayMs(Long milliseconds)
Sets initial scan delay in ms. final Unit
setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. -
-
Method Detail
-
getParams
final BatchBarcodeScannerJsonConfiguration getParams()
-
getNativeParams
final BatchBarcodeScannerNativeConfiguration getNativeParams()
-
setClearButtonTitle
final Unit setClearButtonTitle(String clearButtonTitle)
Text of the button which clears the list of scanned barcodes.
-
setNoBarcodesTitle
final Unit setNoBarcodesTitle(String noBarcodesTitle)
Text of the message that there are no barcodes scanned.
-
setSubmitButtonTitle
final Unit setSubmitButtonTitle(String submitButtonTitle)
Text of the button which finishes the flow.
-
setDetailsBackgroundColor
final Unit setDetailsBackgroundColor(Integer color)
The color of bottom sheet.
-
setDetailsPrimaryColor
final Unit setDetailsPrimaryColor(Integer color)
The color of text elements in bottom sheet.
-
setDetailsActionColor
final Unit setDetailsActionColor(Integer color)
The color of Submit button.
-
setBarcodesCountText
final Unit setBarcodesCountText(String placeholder)
The placeholder for barcodes count text. Should be a string in the following format: "%d Codes".
-
setBarcodesCountTextColor
final Unit setBarcodesCountTextColor(Integer color)
The color for barcodes count text.
-
setFetchingStateText
final Unit setFetchingStateText(String text)
The text for the data fetching state of the barcode item in a list. Smth "Fetching info…".
-
setBarcodeFilter
final Unit setBarcodeFilter(IBarcodeFilter barcodeFilter)
Additional filter to reject or accept barcode scanner results. The default value is an instance of
BarcodeFilter
.
-
setBarcodeFormatsFilter
final Unit setBarcodeFormatsFilter(List<BarcodeFormat> barcodeFormat)
A list of barcodes that the scanner should recognize. Anything not on the list will not trigger a detection.
By default, all supported barcode formats will be recognized.
-
setFormattedBarcodeDataMapper
final Unit setFormattedBarcodeDataMapper(FormattedBarcodeDataMapper dataMapper)
Additional filter to reject or accept barcode scanner results. The default value is an instance of
BarcodeFilter
.
-
setSuccessfulDetectionInterval
final Unit setSuccessfulDetectionInterval(Long detectionIntervalInMs)
Set detection interval between successful frames in milliseconds. Default is 0
- Parameters:
detectionIntervalInMs
- detection interval between successful frames
-
setEngineMode
final Unit setEngineMode(EngineMode engineMode)
Allows to set custom EngineMode for the barcode detection EngineMode.NextGen is used by default
- Parameters:
engineMode
- of the detector to use
-
setAcceptedDocumentFormats
final Unit setAcceptedDocumentFormats(ArrayList<BarcodeDocumentFormat> documentFormats)
A list of document formats that the scanner should recognize. Anything not on the list will not trigger a detection.
By default, all supported barcode document formats will be recognized.
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. The default value is FALSE.
-
setOrientationLockMode
final Unit setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: PORTRAIT or LANDSCAPE. By default the camera orientation is not locked.
-
setSuccessBeepEnabled
final Unit setSuccessBeepEnabled(Boolean successBeepEnabled)
Controls whether to play a beep sound after a successful detection. Default value is TRUE.
-
setTopBarBackgroundColor
final Unit setTopBarBackgroundColor(Integer topBarBackgroundColor)
Background color of the top toolbar.
-
setTopBarButtonsColor
final Unit setTopBarButtonsColor(Integer topBarButtonsColor)
Color of the titles of all buttons in the top toolbar.
-
setTopBarButtonsInactiveColor
final Unit setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of the inactive flash button in the toolbar.
-
setCameraOverlayColor
final Unit setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window.
-
setViewFinderEnabled
final Unit setViewFinderEnabled(Boolean viewFinderEnabled)
Set
true
to enable showing the area of interest on camera preview. Enabled by default.
-
setFinderAspectRatio
final Unit setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window.
-
setFinderLineWidth
final Unit setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px.
-
setFinderLineColor
final Unit setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline.
-
setFinderTextHintColor
final Unit setFinderTextHintColor(Integer finderTextHintColor)
Color of the text hint under the finder window.
-
setUseButtonsAllCaps
final Unit setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style.
-
setAutoCancelTimeout
final Unit setAutoCancelTimeout(Integer seconds)
Sets auto close timer in seconds. 0 = disabled and it is the default value.
-
setCameraZoomRatio
final Unit setCameraZoomRatio(Float zoomRatio)
Set current zoom ratio from 0.5x up to 100x (if supported). Default value is 1x.
- Parameters:
zoomRatio
- Target zoom value to be set.
-
setCameraZoomRange
final Unit setCameraZoomRange(ZoomRange zoomRange)
Set custom camera zoom range. Min value 0.5f and max value 100f (if supported by device). Default value is ZoomRange(0.5x, 100x).
-
setCameraModule
final Unit setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT or others. Optional. By default is CameraModule.BACK.
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-In. Optional, default is Fill-In.
-
setMinFocusDistanceLock
final Unit setMinFocusDistanceLock(Boolean lock)
Locks the minimal supported focus distance and disables a continuous focus
- Parameters:
lock
- iftrue
minimal available focus distance will be locked,false
- otherwise Default isfalse
.
-
setCancelButtonTitle
final Unit setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button.
-
setCancelButtonIcon
final Unit setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button.
-
setFinderTextHint
final Unit setFinderTextHint(String finderTextHint)
Text hint shown under the finder window.
-
setEnableCameraExplanationText
final Unit setEnableCameraExplanationText(String enableCameraExplanationText)
Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera.
-
setEnableCameraButtonTitle
final Unit setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app.
-
setAdditionalDetectionParameters
final Unit setAdditionalDetectionParameters(BarcodeScannerAdditionalConfiguration additionalConfiguration)
Sets additional configuration for BarcodeDetector to further tweak it's logic.
NOTE: these parameters are not intended to be modified unless needed.
Documentation and default values can be seen in BarcodeScannerAdditionalConfiguration.
-
setSelectionOverlayConfiguration
final Unit setSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration)
Controls the state of the Barcode selection overlay. Disabled by default.
Displays contours of the barcode and allows users to select the barcode on a AR-like layer
-
setInitialScanDelayMs
final Unit setInitialScanDelayMs(Long milliseconds)
Sets initial scan delay in ms. 0 = disabled and it is the default value
-
setTouchToFocusEnabled
final Unit setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. Default is
true
.
-
-
-
-