Share via


VibrationEffect.Composition.DelayTypeRelativeStartOffset Field

Definition

Caution

This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.

The delay represents an offset before starting this primitive, relative to the start time of the previous primitive in the composition.

[Android.Runtime.Register("DELAY_TYPE_RELATIVE_START_OFFSET", ApiSince=36)]
[System.Obsolete("This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.", true)]
public const Android.OS.VibrationEffectCompositionDelayType DelayTypeRelativeStartOffset = 1;
[<Android.Runtime.Register("DELAY_TYPE_RELATIVE_START_OFFSET", ApiSince=36)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.OS.VibrationEffectCompositionDelayType enum directly instead of this field.", true)>]
val mutable DelayTypeRelativeStartOffset : Android.OS.VibrationEffectCompositionDelayType

Field Value

Value = 1
Attributes

Remarks

The delay represents an offset before starting this primitive, relative to the start time of the previous primitive in the composition.

The primitive will start at the requested fixed time after the last primitive started, independently of that primitive's actual duration on the device hardware. This enables precise timings of primitives within a composition, ensuring they'll be played at the desired intervals. Here is an example:

VibrationEffect.startComposition()
                    .addPrimitive(PRIMITIVE_CLICK, 1.0)
                    .addPrimitive(PRIMITIVE_TICK, 1.0, 20, DELAY_TYPE_RELATIVE_START_OFFSET)
                    .addPrimitive(PRIMITIVE_THUD, 1.0, 80, DELAY_TYPE_RELATIVE_START_OFFSET)
                    .compose()

Will be performed on the device as follows:

0ms               20ms                     100ms
             PRIMITIVE_CLICK---PRIMITIVE_TICK-----------PRIMITIVE_THUD

A primitive will be dropped from the composition if it overlaps with previous ones.

Java documentation for android.os.VibrationEffect.Composition.DELAY_TYPE_RELATIVE_START_OFFSET.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to