Example usage for com.facebook.react.uimanager.events TouchEventType CANCEL

List of usage examples for com.facebook.react.uimanager.events TouchEventType CANCEL

Introduction

In this page you can find the example usage for com.facebook.react.uimanager.events TouchEventType CANCEL.

Prototype

TouchEventType CANCEL

To view the source code for com.facebook.react.uimanager.events TouchEventType CANCEL.

Click Source Link

Usage

From source file:com.horcrux.svg.RNSVGSvgView.java

License:Open Source License

private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {
    // This means the gesture has already ended, via some other CANCEL or UP event. This is not
    // expected to happen very often as it would mean some child View has decided to intercept the
    // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
    if (mTargetTag == -1) {
        Log.w("error", "Can't cancel already finished gesture. Is a child View trying to start a gesture from "
                + "an UP/CANCEL event?");
        return;// w  w  w .  java2  s  .com
    }

    Assertions.assertNotNull(eventDispatcher)
            .dispatchEvent(TouchEvent.obtain(mTargetTag, SystemClock.nanoTime(), TouchEventType.CANCEL,
                    androidEvent, androidEvent.getX(), androidEvent.getY(), mTouchEventCoalescingKeyHelper));
}

From source file:com.horcrux.svg.SvgView.java

License:Open Source License

private void dispatchCancelEvent(MotionEvent ev) {
    // This means the gesture has already ended, via some other CANCEL or UP event. This is not
    // expected to happen very often as it would mean some child View has decided to intercept the
    // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
    if (mTargetTag == -1) {
        Log.w("error", "Can't cancel already finished gesture. Is a child View trying to start a gesture from "
                + "an UP/CANCEL event?");
        return;/*from w  w w . j  a  v a 2s . co m*/
    }

    dispatch(ev, TouchEventType.CANCEL);
}