Added in API level 30

AccessibilityGestureEvent


class AccessibilityGestureEvent : Parcelable
kotlin.Any
   ↳ android.accessibilityservice.AccessibilityGestureEvent

This class describes the gesture event including gesture id and which display it happens on.

Note: Accessibility services setting the android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_TOUCH_EXPLORATION_MODE flag can receive gestures.

Summary

Inherited constants
Public constructors
AccessibilityGestureEvent(gestureId: Int, displayId: Int, motionEvents: MutableList<MotionEvent!>)

Constructs an AccessibilityGestureEvent to be dispatched to an accessibility service.

Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

static String

Returns a string representation of the specified gesture id.

Int

Returns the display id of the received-gesture display, for use with android.hardware.display.DisplayManager#getDisplay(int).

Int

Returns performed gesture id.

MutableList<MotionEvent!>

Returns the motion events that lead to this gesture.

String

Returns a string representation of the object.

Unit
writeToParcel(parcel: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AccessibilityGestureEvent!>

Public constructors

AccessibilityGestureEvent

Added in API level 33
AccessibilityGestureEvent(
    gestureId: Int,
    displayId: Int,
    motionEvents: MutableList<MotionEvent!>)

Constructs an AccessibilityGestureEvent to be dispatched to an accessibility service.

Parameters
gestureId Int: the id number of the gesture.
displayId Int: the display on which this gesture was performed.
motionEvents MutableList<MotionEvent!>: the motion events that lead to this gesture. This value cannot be null.

Public methods

describeContents

Added in API level 30
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

gestureIdToString

Added in API level 31
static fun gestureIdToString(id: Int): String

Returns a string representation of the specified gesture id.

Return
String This value cannot be null.

getDisplayId

Added in API level 30
fun getDisplayId(): Int

Returns the display id of the received-gesture display, for use with android.hardware.display.DisplayManager#getDisplay(int).

Return
Int the display id.

getGestureId

Added in API level 30
fun getGestureId(): Int

Returns performed gesture id.

Return
Int the performed gesture id. Value is android.accessibilityservice.AccessibilityService#GESTURE_UNKNOWN, android.accessibilityservice.AccessibilityService.GESTURE_TOUCH_EXPLORATION, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_SINGLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_DOUBLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_DOUBLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_TRIPLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_TRIPLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SINGLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SINGLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_DOUBLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_DOUBLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_TRIPLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_TRIPLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_DOUBLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_DOUBLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_UP, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_UP_AND_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_UP_AND_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_UP_AND_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_DOWN_AND_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_DOWN_AND_UP, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_DOWN_AND_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_LEFT_AND_UP, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_LEFT_AND_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_LEFT_AND_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_RIGHT_AND_UP, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_RIGHT_AND_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_SWIPE_RIGHT_AND_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_SWIPE_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_SWIPE_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_SWIPE_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_2_FINGER_SWIPE_UP, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SWIPE_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SWIPE_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SWIPE_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_3_FINGER_SWIPE_UP, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_DOUBLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_DOUBLE_TAP_AND_HOLD, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_SINGLE_TAP, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_SWIPE_DOWN, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_SWIPE_LEFT, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_SWIPE_RIGHT, android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_SWIPE_UP, or android.accessibilityservice.AccessibilityService#GESTURE_4_FINGER_TRIPLE_TAP

getMotionEvents

Added in API level 31
fun getMotionEvents(): MutableList<MotionEvent!>

Returns the motion events that lead to this gesture.

Return
MutableList<MotionEvent!> This value cannot be null.

toString

Added in API level 30
fun toString(): String

Returns a string representation of the object.

Return
String This value cannot be null.

writeToParcel

Added in API level 30
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES
parcel Parcel: This value cannot be null.

Properties