Skip to content

Instantly share code, notes, and snippets.

@nyelito
Created August 26, 2016 17:22
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 nyelito/ce80217da00408e554bc4b6146eab0ca to your computer and use it in GitHub Desktop.
Save nyelito/ce80217da00408e554bc4b6146eab0ca to your computer and use it in GitHub Desktop.
Android Accessibility dispatch gesture not working
@TargetApi(24)
private void pressLocation(Point position){
GestureDescription.Builder builder = new GestureDescription.Builder();
Path p = new Path();
p.lineTo(position.x, position.y);
p.lineTo(position.x+10, position.y+10);
builder.addStroke(new GestureDescription.StrokeDescription(p, 10L, 200L));
GestureDescription gesture = builder.build();
boolean isDispatched = dispatchGesture(gesture, new GestureResultCallback() {
@Override
public void onCompleted(GestureDescription gestureDescription) {
super.onCompleted(gestureDescription);
}
@Override
public void onCancelled(GestureDescription gestureDescription) {
super.onCancelled(gestureDescription);
}
}, null);
Toast.makeText(FingerprintService.this, "Was it dispatched? " + isDispatched, Toast.LENGTH_SHORT).show();
}
@kamike
Copy link

kamike commented Sep 14, 2017

hello,are u solve this problem?i hava same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment