SparkScan View Settings

Defined in package com.scandit.datacapture.barcode.spark.ui

SparkScanViewSettings
class SparkScanViewSettings

Added in version 6.15.0

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.

Deprecated since version 6.23.0: Replaced by inactiveStateTimeout.

inactiveStateTimeout
@NonNull TimeInterval getInactiveStateTimeout()
void setInactiveStateTimeout(@NonNull TimeInterval value)

Added in version 6.23.0

The timeout to automatically stop capturing.

Default is 10 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
@Nullable Integer getHardwareTriggerKeyCode()
void setHardwareTriggerKeyCode(@Nullable Integer value)

Added in version 6.16.0

The button that acts as a scan trigger. Leave null to use the default button (The default button will be the dedicated HW button on XCover devices, and KeyEvent.KEYCODE_VOLUME_DOWN for other devices). This is only taken into consideration if hardwareTriggerEnabled is true.

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.

toastSettings
@NonNull SparkScanToastSettings getToastSettings()
void setToastSettings(@NonNull SparkScanToastSettings value)

Added in version 6.18.0

Sets the toast settings. See SparkScanToastSettings for details.

toJson()
@NonNull String toJson()

Added in version 6.16.0

Returns the JSON representation of the spark scan settings.

ignoreDragLimits
boolean getIgnoreDragLimits()
void setIgnoreDragLimits(boolean value)

Added in version 6.17.0

If set to true the scan button will not be limited vertically in its movement. This makes it possible to interact with the part of the app that might otherwise be covered by it. If the button covers the camera preview when the scanner is started, it will be moved to just under the preview.

Default is true.

Deprecated since version 6.22.0: There is no drag limit anymore. Button can be repositioned all the way from the bottom to the top of the screen.

zoomFactorOut
float getZoomFactorOut()
void setZoomFactorOut(float value)

Added in version 6.23.0

The zoom factor to use for the camera.

Default is 1.

zoomFactorIn
float getZoomFactorIn()
void setZoomFactorIn(float value)

Added in version 6.23.0

The zoom factor to move to when the zoom switch control was tapped.

Default is 2.

targetZoomFactorOut
float getTargetZoomFactorOut()
void setTargetZoomFactorOut(float value)

Added in version 6.18.0

The zoom factor to use for the camera.

Default is 1.

Deprecated since version 6.23.0: Replaced by zoomFactorOut because zoom switch control is now also available in Default scanning mode.

targetZoomFactorIn
float getTargetZoomFactorIn()
void setTargetZoomFactorIn(float value)

Added in version 6.18.0

The zoom factor to move to when the zoom in gesture was performed or zoom switch control was tapped.

Default is 2.

Deprecated since version 6.23.0: Replaced by zoomFactorIn because zoom switch control is now also available in Default scanning mode.

defaultCameraPosition
CameraPosition getDefaultCameraPosition()
void setDefaultCameraPosition(CameraPosition value)

Added in version 6.24.0

Sets the default camera position.

Default is CameraPosition.WORLD_FACING.

Note

This API is still in beta and may change in future versions of Scandit Data Capture SDK.