Created
August 26, 2016 17:22
-
-
Save nyelito/ce80217da00408e554bc4b6146eab0ca to your computer and use it in GitHub Desktop.
Android Accessibility dispatch gesture not working
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
@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(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello,are u solve this problem?i hava same question