Classes | |
enum | CameraSwitchVisibility |
enum | GuiStyle |
enum | MatrixScanState |
Public Member Functions | |
void | setGuiStyle (GuiStyle guiStyle) |
Sound Configuration | |
Customize the scan sound. | |
void | setBeepEnabled (boolean enabled) |
void | setVibrateEnabled (boolean enabled) |
Torch Configuration | |
Enable and customize appearance of the torch icon. | |
void | setTorchEnabled (boolean enabled) |
void | setTorchButtonMarginsAndSize (int leftMargin, int topMargin, int width, int height) |
void | setTorchButtonOffAccessibility (String label, String hint) |
void | setTorchButtonOnAccessibility (String label, String hint) |
Camera Switch Configuration | |
Enable camera switch and set icons | |
void | setCameraSwitchVisibility (CameraSwitchVisibility visibility) |
void | setCameraSwitchButtonMarginsAndSize (int rightMargin, int topMargin, int width, int height) |
void | setCameraSwitchButtonBackAccessibility (String label, String hint) |
void | setCameraSwitchButtonFrontAccessibility (String label, String hint) |
Viewfinder Configuration | |
Customize the viewfinder where the barcode location is highlighted. | |
void | setViewfinderDimension (number width, number height, number landscapeWidth, number landscapeHeight) |
void | setViewfinderColor (String hexColor) |
void | setViewfinderDecodedColor (String hexColor) |
Search Bar Configuration | |
Customize the search bar. | |
void | showSearchBar (boolean show) |
void | setSearchBarKeyboardType (string keyboardType) |
void | setSearchBarActionButtonCaption (String caption) |
void | setSearchBarPlaceholderText (String text) |
Tool Bar Configuration | |
Customize the tool bar (iOS only). | |
void | setToolBarButtonCaption (String caption) |
Non-Official Methods | |
void | setProperty (String key, Object value) |
void | setTextRecognitionSwitchVisible (boolean visible) |
void | setMissingCameraPermissionInfoText (String text) |
void | setMatrixScanHighlightingColor (ScanOverlay.MatrixScanState state, String hexColor) |
Detailed Description
Abstract scan UI class.
The ScanOverlay implements the scan UI displayed on top of the video feed. It is responsible for highlighting barcodes and draw the viewfinder rectangle or laser UI.
- Since
- 4.11.0
Class Documentation
enum Scandit::ScanOverlay::CameraSwitchVisibility |
enum Scandit::ScanOverlay::GuiStyle |
Scan UI style.
Class Members | ||
---|---|---|
DEFAULT |
A rectangular viewfinder with rounded corners is shown in the specified size. Recognized codes are marked with four corners. | |
LASER |
A laser line is shown with the specified width while the height is not changeable. This mode should generally not be used if the recognition is running on the whole screen as it indicates that the code should be placed at the location of the laser line. | |
NONE |
No UI is shown to indicate where the barcode should be placed. Be aware that the Scandit logo continues to be displayed as showing it is part of the license agreement. | |
LOCATIONS_ONLY | Like {Scandit.ScanOverlay.GuiStyle.NONE}, but barcode locations are highlighted in the UI. |
enum Scandit::ScanOverlay::MatrixScanState |
Member Function Documentation
void setGuiStyle | ( | GuiStyle | guiStyle | ) |
The GUI style drawn to display the indicator where the code should be scanned and the visualization of recognized codes.
void setBeepEnabled | ( | boolean | enabled | ) |
Enables (or disables) the sound when a barcode is recognized.
If the phone's ring mode is set to muted or vibrate, no beep will be played regardless of the value.
Enabled by default.
- Since
- 4.11.0
- Parameters
-
enabled Whether the beep is enabled.
void setVibrateEnabled | ( | boolean | enabled | ) |
Enables or disables the vibration when a code was recognized.
If the phone's ring mode is set to muted, no beep will be played regardless of the value.
Enabled by default.
- Since
- 4.11.0
- Parameters
-
enabled Whether vibrate is enabled.
void setTorchEnabled | ( | boolean | enabled | ) |
Enables or disables the torch toggle button for all devices/cameras that support a torch.
By default it is enabled. The torch icon is never shown when the camera does not have a torch (most tablets, front cameras, etc).
- Since
- 4.11.0
- Parameters
-
enabled Whether the torch button should be shown.
void setTorchButtonMarginsAndSize | ( | int | leftMargin, |
int | topMargin, | ||
int | width, | ||
int | height | ||
) |
Sets the position at which the button to enable the torch is drawn.
By default the margins are 15 and width and height are 40.
- Since
- 4.11.0
- Parameters
-
leftMargin Left margin in points. topMargin Top margin in points. width Width in points. height Height in points.
void setTorchButtonOffAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the torch button while the torch is off.
The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently Off)", the default hint "Double-tap to switch the torch on". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setTorchButtonOnAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the torch button while the torch is on.
The accessibility label and hint give vision-impaired users voice over guidance for the torch button while the torch is turned on. The default label is "Torch Switch (Currently On)", the default hint "Double-tap to switch the torch off". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setCameraSwitchVisibility | ( | CameraSwitchVisibility | visibility | ) |
Sets when the camera switch button is visible for devices that have more than one camera.
void setCameraSwitchButtonMarginsAndSize | ( | int | rightMargin, |
int | topMargin, | ||
int | width, | ||
int | height | ||
) |
Sets the position at which the button to switch the camera is drawn.
By default the margins are 15 and width and height are 40.
- Since
- 4.11.0
- Parameters
-
rightMargin Right margin in dp. topMargin Top margin in dp. width Width in dp. height Height in dp.
void setCameraSwitchButtonBackAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the camera switch button while the back-facing camera is active.
The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the back-facing camera is active. The default label is "Camera Switch (Currently back-facing)", the default hint "Double-tap to switch to the front-facing camera". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setCameraSwitchButtonFrontAccessibility | ( | String | label, |
String | hint | ||
) |
Sets the accessibility label and hint for the camera switch button while the front-facing camera is active.
The accessibility label and hint give vision-impaired users voice over guidance for the camera switch button while the front-facing camera is active. The default label is "Camera Switch (Currently front-facing)", the default hint "Double-tap to switch to the back-facing camera". The hint is only set on iOS devices as Android does not support it.
- Since
- 4.11.0
- Parameters
-
label The accessibility label. hint The accessibility hint.
void setViewfinderDimension | ( | number | width, |
number | height, | ||
number | landscapeWidth, | ||
number | landscapeHeight | ||
) |
Sets the size of the viewfinder relative to the size of the BarcodePicker's size.
Changing this value does not(!) affect the area in which barcodes are successfully recognized. It only changes the size of the box drawn onto the scan screen. To restrict the active scanning area, use the methods listed below.
- See also
- ScanSettings.setScanningHotSpot(number, number)
- ScanSettings.setScanningHotSpotHeight(number)
By default the width is 0.8, height is 0.4, landscapeWidth is 0.6, landscapeHeight is 0.4
- Since
- 4.11.0
- Parameters
-
width Width of the viewfinder rectangle in portrait orientation. height Height of the viewfinder rectangle in portrait orientation. landscapeWidth Width of the viewfinder rectangle in landscape orientation. landscapeHeight Height of the viewfinder rectangle in landscape orientation.
void setViewfinderColor | ( | String | hexColor | ) |
Sets the color of the viewfinder before a bar code has been recognized.
Note: This feature is only available with the Scandit SDK Enterprise Packages.
By default this is: white (1.0, 1.0, 1.0)
- Since
- 4.11.0
- Parameters
-
hexColor String of the color's hex value ("FF0000" for red, "00FF00" for green).
void setViewfinderDecodedColor | ( | String | hexColor | ) |
Sets the color of the viewfinder once the bar code has been recognized.
Note: This feature is only available with the Scandit SDK Enterprise Packages.
By default this is: light blue (0.222, 0.753, 0.8)
- Since
- 4.11.0
- Parameters
-
hexColor String of the color's hex value ("FF0000" for red, "00FF00" for green).
void showSearchBar | ( | boolean | show | ) |
Shows (or hides) a search bar at the top of the scan screen.
The search bar allows the user to manually enter the data of a barcode. When the user finished entering data, the manual callback provided to the {BarcodePicker.show} method is invoked with the entered data as a string. 4.11.0 show Whether the search bar should be visible.
void setSearchBarKeyboardType | ( | string | keyboardType | ) |
Sets the type of keyboard that is for entering data into the search bar.
- Since
- 5.9.0
- Parameters
-
keyboardType The type of keyboard, "text" or "number".
void setSearchBarActionButtonCaption | ( | String | caption | ) |
Sets the caption of the search button at the top of the numerical keyboard.
By default this is: "Go"
- Since
- 4.11.0
- Parameters
-
caption Caption of the search button.
void setSearchBarPlaceholderText | ( | String | text | ) |
Sets the text shown in the manual entry field when nothing has been entered yet.
To take effect this has to be called after showSearchBar().
By default this is: "Scan barcode or enter it here"
- Since
- 4.11.0
- Parameters
-
text A placeholder text shown when the search bar is empty.
void setToolBarButtonCaption | ( | String | caption | ) |
Sets the button caption of the cancel button on the tool bar.
By default this is: "Cancel"
- Since
- 4.13.0
- Parameters
-
caption The cancel button's caption.
void setProperty | ( | String | key, |
Object | value | ||
) |
Set custom property.
This function is for internal use/and or experimental features and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not use this method unless you specifically have to.
- Since
- 4.11.0
- Parameters
-
key The name of the property value the value for the property.
void setTextRecognitionSwitchVisible | ( | boolean | visible | ) |
Sets whether the button to switch between different recognition modes should be visible.
If The scanner only supports one recognition mode the button is never shown.
- Since
- 5.4
- Parameters
-
visible Whether the switch should be visible.
void setMissingCameraPermissionInfoText | ( | String | text | ) |
Sets the text shown if the camera can not be aquired because the app does not have permission to access the camera.
- Since
- 5.4
- Parameters
-
text The text that is displayed.
void setMatrixScanHighlightingColor | ( | ScanOverlay.MatrixScanState | state, |
String | hexColor | ||
) |
Sets the color of the tracked barcodes to use for the specified state.
- Since
- 5.7
- Parameters
-
state The state that uses the specified color. hexColor The color to use for tracked barcodes in the specified state. The color is an 8 character hex in the sequence ARGB (alpha, red, green, blue). For example "AAFF00FF" for a slightly transparent purple.