Skip to content

Instantly share code, notes, and snippets.

@mhrpatel12
Created December 12, 2020 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhrpatel12/77c47f110b4dc0698ab60c63f1d2f0e0 to your computer and use it in GitHub Desktop.
Save mhrpatel12/77c47f110b4dc0698ab60c63f1d2f0e0 to your computer and use it in GitHub Desktop.
fun dispatch(x: Float, y: Float): Boolean {
val result = accessibilityService?.dispatchGesture(
buildClick(x, y),
object : GestureResultCallback() {
override fun onCompleted(gestureDescription: GestureDescription?) {
super.onCompleted(gestureDescription)
Log.d(TAG, "gesture completed")
}
override fun onCancelled(gestureDescription: GestureDescription?) {
super.onCancelled(gestureDescription)
Log.d(TAG, "gesture cancelled")
}
},
null
)
return result ?: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment