HapticFeedbackConstantsCompat


class HapticFeedbackConstantsCompat


Helper class for accessing values in android.view.HapticFeedbackConstants.

Summary

Constants

const Int

The user has pressed either an hour or minute tick of a Clock.

const Int
CONFIRM = 16

A haptic effect to signal the confirmation or successful completion of a user interaction.

const Int

The user has performed a context click on an object.

const Int

The user has started a drag-and-drop gesture.

const Int

Flag for performHapticFeedback: Ignore the setting in the view for whether to perform haptic feedback, do it always.

const Int

The user has finished a gesture (e.g. on the soft keyboard).

const Int

The user has started a gesture (e.g. on the soft keyboard).

const Int

The user is executing a swipe/drag-style gesture, such as pull-to-refresh, where the gesture action is “eligible” at a certain threshold of movement, and can be cancelled by moving back past the threshold.

const Int

The user is executing a swipe/drag-style gesture, such as pull-to-refresh, where the gesture action is “eligible” at a certain threshold of movement, and can be cancelled by moving back past the threshold.

const Int

The user has pressed a virtual or software keyboard key.

const Int

The user has released a virtual keyboard key.

const Int

The user has pressed a soft keyboard key.

const Int

The user has performed a long press on an object that is resulting in an action being performed.

const Int

No haptic feedback should be performed.

const Int
REJECT = 17

A haptic effect to signal the rejection or failure of a user interaction.

const Int

The user is switching between a series of many potential choices, for example minutes on a clock face, or individual percentages.

const Int

The user is switching between a series of potential choices, for example items in a list or discrete points on a slider.

const Int

The user has performed a selection/insertion handle move on text field.

const Int

The user has toggled a switch or button into the off position.

const Int

The user has toggled a switch or button into the on position.

const Int

The user has pressed on a virtual on-screen key.

const Int

The user has released a virtual key.

Constants

CLOCK_TICK

Added in 1.11.0
const val CLOCK_TICK = 4: Int

The user has pressed either an hour or minute tick of a Clock.

Compatibility:

  • API <21: No-op

CONFIRM

Added in 1.11.0
const val CONFIRM = 16: Int

A haptic effect to signal the confirmation or successful completion of a user interaction.

Compatibility:

  • API <30: Same feedback as VIRTUAL_KEY

CONTEXT_CLICK

Added in 1.11.0
const val CONTEXT_CLICK = 6: Int

The user has performed a context click on an object.

Compatibility:

  • API <23: Same feedback as CLOCK_TICK
  • API <21: No-op

DRAG_START

Added in 1.11.0
const val DRAG_START = 25: Int

The user has started a drag-and-drop gesture. The drag target has just been "picked up".

Compatibility:

  • API <34: Same feedback as LONG_PRESS

FLAG_IGNORE_VIEW_SETTING

Added in 1.11.0
const val FLAG_IGNORE_VIEW_SETTING = 1: Int

Flag for performHapticFeedback: Ignore the setting in the view for whether to perform haptic feedback, do it always.

GESTURE_END

Added in 1.11.0
const val GESTURE_END = 13: Int

The user has finished a gesture (e.g. on the soft keyboard).

Compatibility:

  • API <30: Same feedback as CONTEXT_CLICK
  • API <21: No-op

GESTURE_START

Added in 1.11.0
const val GESTURE_START = 12: Int

The user has started a gesture (e.g. on the soft keyboard).

Compatibility:

  • API <30: Same feedback as VIRTUAL_KEY

GESTURE_THRESHOLD_ACTIVATE

Added in 1.11.0
const val GESTURE_THRESHOLD_ACTIVATE = 23: Int

The user is executing a swipe/drag-style gesture, such as pull-to-refresh, where the gesture action is “eligible” at a certain threshold of movement, and can be cancelled by moving back past the threshold. This constant indicates that the user's motion has just passed the threshold for the action to be activated on release.

See also
GESTURE_THRESHOLD_DEACTIVATE

Compatibility:

  • API <34: Same feedback as CONTEXT_CLICK
  • API <21: No-op

GESTURE_THRESHOLD_DEACTIVATE

Added in 1.11.0
const val GESTURE_THRESHOLD_DEACTIVATE = 24: Int

The user is executing a swipe/drag-style gesture, such as pull-to-refresh, where the gesture action is “eligible” at a certain threshold of movement, and can be cancelled by moving back past the threshold. This constant indicates that the user's motion has just re-crossed back "under" the threshold for the action to be activated, meaning the gesture is currently in a cancelled state.

See also
GESTURE_THRESHOLD_ACTIVATE

Compatibility:

  • API <34: Same feedback as CLOCK_TICK
  • API <21: No-op

KEYBOARD_PRESS

Added in 1.11.0
const val KEYBOARD_PRESS = 3: Int

The user has pressed a virtual or software keyboard key.

Compatibility:

  • API <27: Same feedback as KEYBOARD_TAP

KEYBOARD_RELEASE

Added in 1.11.0
const val KEYBOARD_RELEASE = 7: Int

The user has released a virtual keyboard key.

Compatibility:

  • API <27: No-op

KEYBOARD_TAP

Added in 1.11.0
const val KEYBOARD_TAP = 3: Int

The user has pressed a soft keyboard key.

LONG_PRESS

Added in 1.11.0
const val LONG_PRESS = 0: Int

The user has performed a long press on an object that is resulting in an action being performed.

NO_HAPTICS

Added in 1.11.0
const val NO_HAPTICS = -1: Int

No haptic feedback should be performed. Applications may use this value to indicate skipping a call to performHapticFeedback entirely, or else rely that it will immediately return false.

Compatibility:

  • API <34: Same behavior, immediately returns false

REJECT

Added in 1.11.0
const val REJECT = 17: Int

A haptic effect to signal the rejection or failure of a user interaction.

Compatibility:

  • API <30: Same feedback as LONG_PRESS

SEGMENT_FREQUENT_TICK

Added in 1.11.0
const val SEGMENT_FREQUENT_TICK = 27: Int

The user is switching between a series of many potential choices, for example minutes on a clock face, or individual percentages. This constant is expected to be very soft, so as not to be uncomfortable when performed a lot in quick succession. If the device can’t make a suitably soft vibration, then it may not make any vibration.

Some specializations of this constant exist for specific actions, notably CLOCK_TICK and TEXT_HANDLE_MOVE.

See also SEGMENT_TICK.

Compatibility:

  • API <34: Same feedback as CLOCK_TICK
  • API <21: No-op

SEGMENT_TICK

Added in 1.11.0
const val SEGMENT_TICK = 26: Int

The user is switching between a series of potential choices, for example items in a list or discrete points on a slider.

See also SEGMENT_FREQUENT_TICK for cases where density of choices is high, and the haptics should be lighter or suppressed for a better user experience.

Compatibility:

  • API <34: Same feedback as CONTEXT_CLICK
  • API <21: No-op

TEXT_HANDLE_MOVE

Added in 1.11.0
const val TEXT_HANDLE_MOVE = 9: Int

The user has performed a selection/insertion handle move on text field.

Compatibility:

  • API <27: No-op

TOGGLE_OFF

Added in 1.11.0
const val TOGGLE_OFF = 22: Int

The user has toggled a switch or button into the off position.

Compatibility:

  • API <34: Same feedback as CLOCK_TICK
  • API <21: No-op

TOGGLE_ON

Added in 1.11.0
const val TOGGLE_ON = 21: Int

The user has toggled a switch or button into the on position.

Compatibility:

  • API <34: Same feedback as CONTEXT_CLICK
  • API <21: No-op

VIRTUAL_KEY

Added in 1.11.0
const val VIRTUAL_KEY = 1: Int

The user has pressed on a virtual on-screen key.

VIRTUAL_KEY_RELEASE

Added in 1.11.0
const val VIRTUAL_KEY_RELEASE = 8: Int

The user has released a virtual key.

Compatibility:

  • API <27: No-op