Builder
class Builder
| kotlin.Any | |
| ↳ | android.os.VibrationAttributes.Builder |
Builder class for VibrationAttributes objects. By default, all information is set to UNKNOWN.
Summary
| Public constructors | |
|---|---|
Builder()Constructs a new Builder with the defaults. |
|
Builder(audio: AudioAttributes)Constructs a new Builder from AudioAttributes. |
|
Builder(vib: VibrationAttributes?)Constructs a new Builder from a given VibrationAttributes. |
|
| Public methods | |
|---|---|
| VibrationAttributes |
build()Combines all of the attributes that have been set and returns a new |
| VibrationAttributes.Builder |
Sets only the flags specified in the bitmask, leaving the other supported flag values unchanged in the builder. |
| VibrationAttributes.Builder |
Sets the attribute describing the type of the corresponding vibration. |
Public constructors
Builder
Builder(audio: AudioAttributes)
Constructs a new Builder from AudioAttributes.
| Parameters | |
|---|---|
audio |
AudioAttributes: This value cannot be null. |
Builder
Builder(vib: VibrationAttributes?)
Constructs a new Builder from a given VibrationAttributes.
| Parameters | |
|---|---|
vib |
VibrationAttributes?: This value may be null. |
Public methods
build
fun build(): VibrationAttributes
Combines all of the attributes that have been set and returns a new VibrationAttributes object.
| Return | |
|---|---|
VibrationAttributes |
a new VibrationAttributes object This value cannot be null. |
setFlags
fun setFlags(
flags: Int,
mask: Int
): VibrationAttributes.Builder
Sets only the flags specified in the bitmask, leaving the other supported flag values unchanged in the builder.
| Parameters | |
|---|---|
flags |
Int: Combination of flags to be set. Value is either 0 or a combination of android.os.VibrationAttributes#FLAG_BYPASS_INTERRUPTION_POLICY, android.os.VibrationAttributes.FLAG_BYPASS_USER_VIBRATION_INTENSITY_OFF, android.os.VibrationAttributes.FLAG_INVALIDATE_SETTINGS_CACHE, and android.os.VibrationAttributes.FLAG_PIPELINED_EFFECT |
mask |
Int: Bit range that should be changed. |
| Return | |
|---|---|
VibrationAttributes.Builder |
the same Builder instance. This value cannot be null. |
setUsage
fun setUsage(usage: Int): VibrationAttributes.Builder
Sets the attribute describing the type of the corresponding vibration.
| Parameters | |
|---|---|
usage |
Int: The type of usage for the vibration Value is android.os.VibrationAttributes#USAGE_UNKNOWN, android.os.VibrationAttributes#USAGE_ACCESSIBILITY, android.os.VibrationAttributes#USAGE_ALARM, android.os.VibrationAttributes#USAGE_COMMUNICATION_REQUEST, android.os.VibrationAttributes#USAGE_HARDWARE_FEEDBACK, android.os.VibrationAttributes#USAGE_MEDIA, android.os.VibrationAttributes#USAGE_NOTIFICATION, android.os.VibrationAttributes#USAGE_PHYSICAL_EMULATION, android.os.VibrationAttributes#USAGE_RINGTONE, android.os.VibrationAttributes#USAGE_TOUCH, android.os.VibrationAttributes.USAGE_IME_FEEDBACK, or android.os.VibrationAttributes#USAGE_GESTURE_INPUT |
| Return | |
|---|---|
VibrationAttributes.Builder |
the same Builder instance. This value cannot be null. |