GestureDescription
class GestureDescription
kotlin.Any | |
↳ | android.accessibilityservice.GestureDescription |
Accessibility services with the android.R.styleable#AccessibilityService_canPerformGestures
property can dispatch gestures. This class describes those gestures. Gestures are made up of one or more strokes. Gestures are immutable once built and will be dispatched to the specified display.
Spatial dimensions throughout are in screen pixels. Time is measured in milliseconds.
Summary
Nested classes | |
---|---|
Builder for a |
|
Immutable description of stroke that can be part of a gesture. |
Public methods | |
---|---|
Int |
Returns the ID of the display this gesture is sent on, for use with |
static Long |
Get the upper limit on a gesture's duration. |
static Int |
Get the upper limit for the number of strokes a gesture may contain. |
GestureDescription.StrokeDescription! |
Read a stroke from the gesture |
Int |
Get the number of stroke in the gesture. |
Public methods
getDisplayId
fun getDisplayId(): Int
Returns the ID of the display this gesture is sent on, for use with android.hardware.display.DisplayManager#getDisplay(int)
.
Return | |
---|---|
Int |
The logical display id. |
getMaxGestureDuration
static fun getMaxGestureDuration(): Long
Get the upper limit on a gesture's duration.
Return | |
---|---|
Long |
The maximum duration in milliseconds. |
getMaxStrokeCount
static fun getMaxStrokeCount(): Int
Get the upper limit for the number of strokes a gesture may contain.
Return | |
---|---|
Int |
The maximum number of strokes. |
getStroke
fun getStroke(index: Int): GestureDescription.StrokeDescription!
Read a stroke from the gesture
Parameters | |
---|---|
index |
Int: the index of the stroke Value is 0 or greater |
Return | |
---|---|
GestureDescription.StrokeDescription! |
A description of the stroke. |
getStrokeCount
fun getStrokeCount(): Int
Get the number of stroke in the gesture.
Return | |
---|---|
Int |
the number of strokes in this gesture |