Page Summary
-
Node.OnTouchListeneris an interface used to handle touch events dispatched to a Sceneform node. -
It provides a callback method
onTouchwhich is invoked before the node'sonTouchEvent. -
onTouchreceives aHitTestResultindicating the touched node and aMotionEventwith event details. -
Returning
truefromonTouchconsumes the event, preventing further processing by other listeners or the node itself.
Interface definition for a callback to be invoked when a touch event is dispatched to this
node. The callback will be invoked before onTouchEvent(HitTestResult, MotionEvent) is
called.
Public Methods
| abstract boolean |
onTouch(HitTestResult hitTestResult, MotionEvent motionEvent)
Handles when a touch event has been dispatched to a node.
|
Public Methods
public abstract boolean onTouch (HitTestResult hitTestResult, MotionEvent motionEvent)
Handles when a touch event has been dispatched to a node.
On ACTION_DOWN events, getNode() will always be
this node or one of its children. On other events, the touch may have moved causing the
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