Created
December 12, 2020 11:51
-
-
Save mhrpatel12/77c47f110b4dc0698ab60c63f1d2f0e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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