خرید بک لینک

Vote count: 0

With API 24 we got a way to dispatch a gesture to the device, however there is no solid documentation or examples out there yet. I am trying to get it to work but currently the gesture is hitting the "onCancelled" callback every time.

Here is my code that calls the method:

@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();
}`

Has anyone used this new method yet or know of an example of how to get it functioning?

asked 19 secs ago

برچسب: how does the internet work,how does the nearby pokemon work,how does the brain work,how does the martian end,how does the voice work,how does the heart work,how does the shallows end,how does the pill work,how does the sun produce energy,how does the stock market work, نویسنده: استخدام کار تاريخ: جمعه 12 شهريور 1395 ساعت: 10:07

صفحه بندی