Interface Node.OnTouchListener

  • Enclosing class:
    Node

    public static interface Node.OnTouchListener
    Interface definition for a callback to be invoked when a touch event is dispatched to this node. The callback will be invoked before Node.onTouchEvent(HitTestResult, MotionEvent) is called.
    • Method Detail

      • onTouch

        boolean onTouch​(HitTestResult hitTestResult,
                        android.view.MotionEvent motionEvent)
        Handles when a touch event has been dispatched to a node.

        On MotionEvent.ACTION_DOWN events, HitTestResult.getNode() will always be this node or one of its children. On other events, the touch may have moved causing the HitTestResult.getNode() to change (or possibly be null).

        Parameters:
        hitTestResult - represents the node that was touched and information about where it was touched
        motionEvent - the MotionEvent object containing full information about the event
        Returns:
        true if the listener has consumed the event, false otherwise