HapticFeedbackRequest.Builder


public static final class HapticFeedbackRequest.Builder
extends Object

java.lang.Object
   ↳ android.os.vibrator.HapticFeedbackRequest.Builder


Builder for HapticFeedbackRequest.

Summary

Public constructors

Builder(HapticFeedbackRequest request)

Constructs a builder that is already populated with the fields from a given HapticFeedbackRequest.

Builder(int constant)

Constructs a new builder for HapticFeedbackRequest.

Public methods

HapticFeedbackRequest build()

Builds a new HapticFeedbackRequest from this builder object.

HapticFeedbackRequest.Builder setFlags(int flags)

Sets the HapticFeedbackConstants flags for the haptic feedback request.

HapticFeedbackRequest.Builder setUsage(int usage)

Sets the VibrationAttributes usage for the haptic feedback request.

Inherited methods

Public constructors

Builder

public Builder (HapticFeedbackRequest request)

Constructs a builder that is already populated with the fields from a given HapticFeedbackRequest.

Parameters
request HapticFeedbackRequest: the request to create a new builder from. This value cannot be null.

Builder

public Builder (int constant)

Constructs a new builder for HapticFeedbackRequest.

Parameters
constant int: the haptic feedback constant for HapticFeedbackRequest that will be constructed from the builder. This needs to be one of the constants defined in HapticFeedbackConstants. Value is HapticFeedbackConstants.NO_HAPTICS, HapticFeedbackConstants.LONG_PRESS, HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.CLOCK_TICK, android.view.HapticFeedbackConstants.CALENDAR_DATE, HapticFeedbackConstants.CONTEXT_CLICK, HapticFeedbackConstants.KEYBOARD_RELEASE, HapticFeedbackConstants.VIRTUAL_KEY_RELEASE, HapticFeedbackConstants.TEXT_HANDLE_MOVE, android.view.HapticFeedbackConstants.DRAG_CROSSING, HapticFeedbackConstants.GESTURE_START, HapticFeedbackConstants.GESTURE_END, android.view.HapticFeedbackConstants.EDGE_SQUEEZE, android.view.HapticFeedbackConstants.EDGE_RELEASE, HapticFeedbackConstants.CONFIRM, HapticFeedbackConstants.REJECT, android.view.HapticFeedbackConstants.SCROLL_TICK, android.view.HapticFeedbackConstants.SCROLL_ITEM_FOCUS, android.view.HapticFeedbackConstants.SCROLL_LIMIT, HapticFeedbackConstants.TOGGLE_ON, HapticFeedbackConstants.TOGGLE_OFF, HapticFeedbackConstants.GESTURE_THRESHOLD_ACTIVATE, HapticFeedbackConstants.GESTURE_THRESHOLD_DEACTIVATE, HapticFeedbackConstants.DRAG_START, HapticFeedbackConstants.SEGMENT_TICK, HapticFeedbackConstants.SEGMENT_FREQUENT_TICK, android.view.HapticFeedbackConstants.SAFE_MODE_ENABLED, android.view.HapticFeedbackConstants.ASSISTANT_BUTTON, android.view.HapticFeedbackConstants.LONG_PRESS_POWER_BUTTON, android.view.HapticFeedbackConstants.BIOMETRIC_CONFIRM, or android.view.HapticFeedbackConstants.BIOMETRIC_REJECT

Public methods

build

public HapticFeedbackRequest build ()

Builds a new HapticFeedbackRequest from this builder object.

Returns
HapticFeedbackRequest This value cannot be null.

setFlags

public HapticFeedbackRequest.Builder setFlags (int flags)

Sets the HapticFeedbackConstants flags for the haptic feedback request.

Parameters
flags int: Value is either 0 or a combination of HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING, and HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING

Returns
HapticFeedbackRequest.Builder This value cannot be null.