DispatchGesture
Added in the API level 24
Public final Boolean dispatchGesture (GestureDescription gestures, AccessibilityService. GestureResultCallback callback, Handler Handler)
Send gestures to touch screen, the current ongoing any gestures, whether from the user, the service or other services, will be canceled,
Gestures will be dispatch, as if it were performed by the user directly on the screen, so the event may be affected by functions such as amplification and touch to browse,
Note: in order to dispatch gestures, your service must be R.s. Tyleable AccessibilityService_canPerformGestures setting attributes to declare functions in its metadata, for more information, see SERVICE_META_DATA,
Parameter
Gesture
GestureDescription: dispatch of gestures can this value is not null,
The callback
State AccessibilityService. GestureResultCallback: know gestures to the callback object, if is null, no status report, this value may be null,
Handler
Handler: in the last time the callback Handler object, if is null, the main thread of the service, the last time the object, this value may be null,
Returns
Boolean
True for scheduled gestures, false is no,
The official document:
DispatchGesture
Internet API level 24
Public final Boolean dispatchGesture (GestureDescription gesture, AccessibilityService GestureResultCa
Handler Handler)
Dispatch a gesture to the touch screen. Any gestures currently in progress, been the from the user, this service, or another service, will be cancelled.
The gesture will be dispatched as if it were performed directly on The screen by a user, so The events may be affected by The features to The as magnification and explore by touch.
Note: In order to dispatch gestures, your service must declare the capability by setting the R.s. Tyleable AccessibilityService_canPerformGestures property In its meta - data. For more information, see SERVICE_META_DATA.
The Parameters
Gesture
GestureDescription: The gesture to dispatch This value must never be null.
The callback
AccessibilityService.
GestureResultCallback: The object to call back when The status of The gesture is known. If null, no status is reported. This value may be null.
Handler
Handler: The Handler on which to call back The callback object. If null, The object is called The back on The service 's main thread. This value may be null.
Returns
Boolean
True if the gesture is dispatched, false if not