Taal

VibrationEffect.Builder.AddPreset(Int64, VibrationEffect+Preset) Method

Definition

Adds a predefined haptic Preset to the composition.

[Android.Runtime.Register("addPreset", "(JLandroid/os/VibrationEffect$Preset;)Landroid/os/VibrationEffect$Builder;", "", ApiSince=37)]
public Android.OS.VibrationEffect.Builder AddPreset(long startTimeMillis, Android.OS.VibrationEffect.Preset preset);
[<Android.Runtime.Register("addPreset", "(JLandroid/os/VibrationEffect$Preset;)Landroid/os/VibrationEffect$Builder;", "", ApiSince=37)>]
member this.AddPreset : int64 * Android.OS.VibrationEffect.Preset -> Android.OS.VibrationEffect.Builder

Parameters

startTimeMillis
Int64

The time in milliseconds from the start of the composition to start the preset. Value is a non-negative duration in milliseconds.

preset
VibrationEffect.Preset

The Preset to add. This value cannot be null.

Returns

This Builder object. This value cannot be null.

Attributes

Remarks

Adds a predefined haptic Preset to the composition.

The startTimeMillis is the time in milliseconds from the start of the composition being built. The preset will be scheduled to start at this time.

The builder performs best-effort validation to prevent overlaps with previously added elements. However, the exact duration of a Preset can be device-dependent. It is the caller's responsibility to choose an appropriate startTimeMillis to avoid unintended overlaps.

Android reference for android.os.VibrationEffect.Builder.addPreset.

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