SparkScan View Settings
Defined in package com.scandit.datacapture.barcode.spark.ui
- SparkScanViewSettings
class SparkScanViewSettings
Added in version 6.15.0
- SparkScanViewSettings()
SparkScanViewSettings(@NonNull TimeInterval triggerButtonCollapseTimeout, @NonNull TimeInterval continuousCaptureTimeout, TorchState defaultTorchState, @NonNull SparkScanScanningMode defaultScanningMode, SparkScanViewHandMode defaultHandMode,
boolean
holdToScanEnabled,boolean
soundEnabled,boolean
hapticEnabled,boolean
hardwareTriggerEnabled,int
hardwareTriggerKeyCode,boolean
visualFeedbackEnabled)Added in version 6.15.0
Constructs a new SparkScan view settings to use when creating an instance of the SparkScanView.
Warning
Changing the values of SparkScanViewSettings instance after the creation of SparkScanView does not result in applying the changed settings to the corresponding view.
- triggerButtonCollapseTimeout
@NonNull TimeInterval getTriggerButtonCollapseTimeout()
void
setTriggerButtonCollapseTimeout(@NonNull TimeInterval value)Added in version 6.15.0
The timeout to automatically switch to idle state. When set to negative value timeout is infinite.
Default is infinite.
- continuousCaptureTimeout
@NonNull TimeInterval getContinuousCaptureTimeout()
void
setContinuousCaptureTimeout(@NonNull TimeInterval value)Added in version 6.15.0
The timeout to automatically stop capturing when the view is configured in SparkScanScanningBehavior.CONTINUOUS capturing mode.
Default is 60 seconds.
- defaultScanningMode
@NonNull SparkScanScanningMode getDefaultScanningMode()
void
setDefaultScanningMode(@NonNull SparkScanScanningMode value)Added in version 6.16.0
Sets the default scanning mode of the view.
Default is Default.
- defaultTorchState
TorchState getDefaultTorchState()
void
setDefaultTorchState(TorchState value)Added in version 6.15.0
Sets the default torch state of the camera.
Default is TorchState.OFF.
- soundEnabled
boolean
getSoundEnabled()void
setSoundEnabled(boolean
value)Added in version 6.16.0
Indicates whether the feedback should have sound enabled.
Default is true.
- hapticEnabled
boolean
getHapticEnabled()void
setHapticEnabled(boolean
value)Added in version 6.16.0
Indicates whether the feedback should have haptics enabled.
Default is true.
- defaultHandMode
SparkScanViewHandMode getDefaultHandMode()
void
setDefaultHandMode(SparkScanViewHandMode value)Added in version 6.15.0
Sets the default hand mode of the view.
Default is SparkScanViewHandMode.RIGHT.
- holdToScanEnabled
boolean
getHoldToScanEnabled()void
setHoldToScanEnabled(boolean
value)Added in version 6.16.0
Indicates whether to keep scanning as long as the scan button is pressed.
Default is true.
- hardwareTriggerEnabled
boolean
getHardwareTriggerEnabled()void
setHardwareTriggerEnabled(boolean
value)Added in version 6.16.0
Sets whether the SparkScanView should react to clicks on the hardware button specified in hardwareTriggerKeyCode. Disabled by default.
Note
This feature is only available on devices with api >= 28. Whether a device supports this can be checked at runtime with the SparkScanView.hardwareTriggerSupported flag.
- hardwareTriggerKeyCode
int
getHardwareTriggerKeyCode()void
setHardwareTriggerKeyCode(int
value)Added in version 6.16.0
The button that acts as a scan trigger. By default set to KeyEvent.KEYCODE_VOLUME_DOWN. This is only taken into consideration if hardwareTriggerEnabled is true.
Default is set to the “volume down” key.
- visualFeedbackEnabled
boolean
getVisualFeedbackEnabled()void
setVisualFeedbackEnabled(boolean
value)Added in version 6.16.0
Indicates whether the visual feedback on scan should be displayed.
Default is true.