Taal

VibrationEffect.Builder.AddEnvelope(Int64, VibrationEffect+Envelope) Method

Definition

Adds a haptic Envelope to the composition.

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

Parameters

startTimeMillis
Int64

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

envelope
VibrationEffect.Envelope

The Envelope to add. This value cannot be null.

Returns

This Builder object. This value cannot be null.

Attributes

Remarks

Adds a haptic Envelope to the composition.

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

The builder performs best-effort validation to prevent overlaps with previously added elements. The duration of an Envelope is generally well-defined, but care should still be taken with the startTimeMillis to ensure correct sequencing with other elements.

Fallback Support: If the envelope is created using WaveformEnvelopeBuilder, fallback support is not provided. If the device does not support the envelope, the entire vibration effect may fail to play. Envelopes created using BasicEnvelopeBuilder will have fallback support.

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

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