Class GenericDocumentRecognizerConfiguration
-
- All Implemented Interfaces:
public final class GenericDocumentRecognizerConfiguration
Class which is used to configure io.scanbot.sdk.ui.view.genericdocument.GenericDocumentRecognizerActivity Contains settings indicating views Behaviour, Texts and Appearance
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
GenericDocumentRecognizerConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final GenericDocumentRecognizerJsonConfiguration
params
private final GenericDocumentRecognizerNativeConfiguration
nativeParams
public final static GenericDocumentRecognizerConfiguration.Companion
Companion
-
Constructor Summary
Constructors Constructor Description GenericDocumentRecognizerConfiguration()
-
Method Summary
Modifier and Type Method Description final GenericDocumentRecognizerJsonConfiguration
getParams()
final GenericDocumentRecognizerNativeConfiguration
getNativeParams()
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
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
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)
Color of the titles of all buttons in the top toolbar. final Unit
setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside 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
setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button. final Unit
setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button. 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
setClearButtonTitle(String clearButtonTitle)
Text of the button which clears the list of scanned fields. 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 Clear and Submit buttons final Unit
setFieldsCountTextColor(Integer color)
Text color of the fields count label. final Unit
setFieldConfidenceHighColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is high. final Unit
setFieldConfidenceModerateColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is moderate. final Unit
setFieldConfidenceLowColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is low. final Unit
setFieldConfidenceTextColor(Integer color)
Color of confidence value label text in details. final Unit
setTipTextColor(Integer color)
Color of tip text on scanning screen. final Unit
setTipBackgroundColor(Integer color)
Color of tip background on scanning screen. final Unit
setFieldsCountText(String text)
String used for displaying amount of detected fields. final Unit
setConfidenceValue(String text)
String that shows average confidence value of scanned document. final Unit
setScanBackSideTitle(String text)
String that asks user to scan back side of a document. final Unit
setScanFrontSideTitle(String text)
String that asks user to scan front side of a document. final Unit
setStartScanningTitle(String text)
String that asks user to start scanning a document. final Unit
setScannedEverythingTitle(String text)
String that notifies that both sides of document are scanned. final Unit
setImageTitle(String text)
A title to show image content. final Unit
setNoDataTitle(String text)
String that notifies that nothing was scanned yet. final Unit
setAcceptedDocumentTypes(ArrayList<RootDocumentType> documentTypes)
Accepted document types. final Unit
setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style final Unit
setFieldsDisplayConfiguration(HashMap<String, FieldProperties> configuration)
Allows to configure the display configuration for fields. final Unit
setDocumentDisplayConfiguration(HashMap<String, DocumentProperties> configuration)
Allows to configure the display configuration for documents. final Unit
setExcludedFieldTypes(HashSet<String> excludedFields)
Set of secure fields which should be excluded from scanning process. final Unit
setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. -
-
Method Detail
-
getParams
final GenericDocumentRecognizerJsonConfiguration getParams()
-
getNativeParams
final GenericDocumentRecognizerNativeConfiguration getNativeParams()
-
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.
-
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.
-
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)
Color of the titles of all buttons in the top toolbar.
-
setCameraOverlayColor
final Unit setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside 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.
-
setCancelButtonTitle
final Unit setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button.
-
setCancelButtonIcon
final Unit setCancelButtonIcon(Integer cancelButtonIcon)
Icon of the cancel button.
-
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.
-
setClearButtonTitle
final Unit setClearButtonTitle(String clearButtonTitle)
Text of the button which clears the list of scanned fields.
-
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 Clear and Submit buttons
-
setFieldsCountTextColor
final Unit setFieldsCountTextColor(Integer color)
Text color of the fields count label.
-
setFieldConfidenceHighColor
final Unit setFieldConfidenceHighColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is high.
-
setFieldConfidenceModerateColor
final Unit setFieldConfidenceModerateColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is moderate.
-
setFieldConfidenceLowColor
final Unit setFieldConfidenceLowColor(Integer color)
Color of confidence value label background in details screen, when the field confidence level is low.
-
setFieldConfidenceTextColor
final Unit setFieldConfidenceTextColor(Integer color)
Color of confidence value label text in details.
-
setTipTextColor
final Unit setTipTextColor(Integer color)
Color of tip text on scanning screen.
-
setTipBackgroundColor
final Unit setTipBackgroundColor(Integer color)
Color of tip background on scanning screen.
-
setFieldsCountText
final Unit setFieldsCountText(String text)
String used for displaying amount of detected fields. Use %d for number formatting symbol.
-
setConfidenceValue
final Unit setConfidenceValue(String text)
String that shows average confidence value of scanned document. Use %d as number formatting symbol.
-
setScanBackSideTitle
final Unit setScanBackSideTitle(String text)
String that asks user to scan back side of a document.
-
setScanFrontSideTitle
final Unit setScanFrontSideTitle(String text)
String that asks user to scan front side of a document.
-
setStartScanningTitle
final Unit setStartScanningTitle(String text)
String that asks user to start scanning a document.
-
setScannedEverythingTitle
final Unit setScannedEverythingTitle(String text)
String that notifies that both sides of document are scanned.
-
setImageTitle
final Unit setImageTitle(String text)
A title to show image content.
-
setNoDataTitle
final Unit setNoDataTitle(String text)
String that notifies that nothing was scanned yet.
-
setAcceptedDocumentTypes
final Unit setAcceptedDocumentTypes(ArrayList<RootDocumentType> documentTypes)
Accepted document types. All other document types will be ignored.
By default - GenericDocumentRecognizer.ACCEPTED_TYPES
-
setUseButtonsAllCaps
final Unit setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style
-
setFieldsDisplayConfiguration
final Unit setFieldsDisplayConfiguration(HashMap<String, FieldProperties> configuration)
Allows to configure the display configuration for fields.
Usage: The map of the normalized field name (can be taken from io.scanbot.genericdocument.entity.DePassport.NormalizedFieldNames, io.scanbot.genericdocument.entity.DeIdCardBack.NormalizedFieldNames, etc.) to FieldProperties object (display name and visibility) is expected.
hashMapOf( DePassport.NormalizedFieldNames.PHOTO to FieldProperties( context.getString(R.string.photo_display_name), FieldProperties.DisplayState.AlwaysVisible ), MRZ.NormalizedFieldNames.CHECK_DIGIT to FieldProperties( context.getString(R.string.check_digit_display_name), FieldProperties.DisplayState.AlwaysVisible ) )
-
setDocumentDisplayConfiguration
final Unit setDocumentDisplayConfiguration(HashMap<String, DocumentProperties> configuration)
Allows to configure the display configuration for documents.
Usage: The map of the normalized document name (can be taken from document name, for example io.scanbot.genericdocument.entity.DeDriverLicenseBack.Categories.DOCUMENT_NORMALIZED_TYPE, io.scanbot.genericdocument.entity.DeDriverLicenseBack.Categories.A.DOCUMENT_NORMALIZED_TYPE, etc.) to DocumentProperties object is expected.
hashMapOf( DeDriverLicenseBack.Categories.DOCUMENT_NORMALIZED_TYPE to DocumentProperties(context.getString(R.string.category_display_name)), DeDriverLicenseBack.Categories.A.DOCUMENT_NORMALIZED_TYPE to DocumentProperties(context.getString(R.string.category_A_display_name)), )
-
setExcludedFieldTypes
final Unit setExcludedFieldTypes(HashSet<String> excludedFields)
Set of secure fields which should be excluded from scanning process. All other fields will be scanned as usual. Field should be set ONLY as normalized field name. Example: DePassport.NormalizedFieldNames.NATIONALITY or DeIdCardBack.NormalizedFieldNames.HEIGHT
By default - empty and all fields are scanned
-
setTouchToFocusEnabled
final Unit setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. Default is
true
.
-
-
-
-