VibrationEffectInflater


public final class VibrationEffectInflater
extends Object

java.lang.Object
   ↳ android.view.VibrationEffectInflater


Instantiates VibrationEffect objects from Android XML resources.

Summary

Public methods

static VibrationEffectInflater from(Context context)

Obtains the VibrationEffectInflater associated with the given context.

VibrationEffect inflate(int resId)

Inflates a VibrationEffect from an Android XML resource containing a vibration pattern (e.g., stored inside res/xml/).

Inherited methods

Public methods

from

Added in API level 10000
public static VibrationEffectInflater from (Context context)

Obtains the VibrationEffectInflater associated with the given context.

Parameters
context Context: The context to access resources.
This value cannot be null.

Returns
VibrationEffectInflater The VibrationEffectInflater instance.
This value cannot be null.

inflate

Added in API level 10000
public VibrationEffect inflate (int resId)

Inflates a VibrationEffect from an Android XML resource containing a vibration pattern (e.g., stored inside res/xml/).

For dynamic vibration patterns, see VibrationEffect.parseFromXml.

Parameters
resId int: The resource ID containing the vibration XML pattern.

Returns
VibrationEffect Parsed VibrationEffect.
This value cannot be null.

Throws
InflateException If there's an inflation error.