Feedback

Defined in package com.scandit.datacapture.core

Vibration
class Vibration

Added in version 8.6.0

A vibration, to be emitted for example when a code has been successfully scanned.

defaultVibration()
fun Vibration.defaultVibration(): Vibration

Added in version 8.6.0

The default vibration for a successful scan.

selectionHapticFeedback()
fun Vibration.selectionHapticFeedback(): Vibration

Added in version 8.6.0

Haptic feedback indicating a change in selection. iOS-backed; on Android this falls back to the default vibration.

successHapticFeedback()
fun Vibration.successHapticFeedback(): Vibration

Added in version 8.6.0

Haptic feedback for a successful scan. iOS-backed; on Android this falls back to the default vibration.

failureHapticFeedback()
fun Vibration.failureHapticFeedback(): Vibration

Added in version 8.6.0

It creates haptics to communicate failures. This is a notification feedback type, indicating that a task has failed. In particular it uses UINotificationFeedbackGenerator with type UINotificationFeedbackTypeError. Please note that if the device does not have the Taptic Engine, no vibration will be emitted.

On Android this falls back to the default vibration.

impactHapticFeedback()
fun Vibration.impactHapticFeedback(): Vibration

Added in version 8.6.0

It creates haptics to communicate impact. In particular it uses UIImpactFeedbackGenerator. Please note that if the device does not have the Taptic Engine, no vibration will be emitted.

Sound
class Sound

Added in version 8.6.0

A sound, to be played for example when a code has been successfully scanned.

defaultSound()
fun Sound.defaultSound(): Sound

Added in version 8.6.0

The default beep sound for a successful scan.

fromResource(resource)
fun Sound.fromResource(resource: String): Sound

Added in version 8.6.0

Creates a new sound from the given resource name (KMP cross-platform factory).

Feedback
class Feedback

Added in version 8.6.0

A feedback consisting of a sound and vibration, for example to be provided by a device when a code has been successfully scanned.

defaultFeedback()
fun Feedback.defaultFeedback(): Feedback

Added in version 8.6.0

The default feedback consisting of a default sound and a default vibration.

sound
var sound: Sound?

Added in version 8.6.0

The sound to be played when a feedback is required. If null, no sound is played. Depending on the device’s ring mode and/or volume settings, no sound may be played even if this property is properly set to a non-null instance.

vibration
var vibration: Vibration?

Added in version 8.6.0

The vibration to be emitted when a feedback is required. If null, no vibration is emitted. This property is further influenced by the device’s ring mode: the device may not vibrate even if this property is properly set to a non-null instance.

emit()
fun emit()

Added in version 8.6.0

Emits the feedback defined by this object. This method is further influenced by the device’s ring mode and/or volume settings - check sound and vibration for more details.

WaveFormVibration
class WaveFormVibration : Vibration

Added in version 8.6.0

A wave form vibration, to be emitted for example when a code has been successfully scanned.

The timings array must be non-empty. If amplitudes is provided, it must contain the same number of elements as timings.

WaveFormVibration()
WaveFormVibration(timings: LongArray)

Added in version 8.6.0

Creates a new WaveFormVibration object with timings.

WaveFormVibration()
WaveFormVibration(timings: LongArray,
        amplitudes: IntArray?)

Added in version 8.6.0

Creates a new WaveFormVibration object with timings and amplitudes.

amplitudes
val amplitudes: IntArray?

Added in version 8.6.0

Returns the amplitudes of the WaveFormVibration.

timings
val timings: LongArray

Added in version 8.6.0

Returns the timings of the WaveFormVibration.