The second Android 11 Developer Preview is now available, test it out and share your feedback.

PointerInputNode

class PointerInputNode : ComponentNode
kotlin.Any
   ↳ androidx.ui.core.ComponentNode
   ↳ androidx.ui.core.PointerInputNode

Backing node for handling pointer events.

Summary

Public constructors

Backing node for handling pointer events.

Inherited functions

Inherited extension functions

From androidx.ui.core
Unit

Inserts a child ComponentNode at a last index.

ComponentNode?

Executes selector on every parent of this ComponentNode and returns the closest ComponentNode to return true from selector or null if selector returns false for all ancestors.

LayoutNode?

Executes block on first level of LayoutNode descendants of this ComponentNode and returns the last LayoutNode to return true from block.

Boolean

Returns true if this ComponentNode has no descendant LayoutNodes.

Boolean

Returns true if this ComponentNode currently has an ComponentNode.owner.

Owner

Returns ComponentNode.owner or throws if it is null.

Unit

Executes block on first level of LayoutNode descendants of this ComponentNode.

Properties

() -> Unit

Invoked to notify the handler that no more calls to pointerInputHandler will be made, until at least new pointers exist.

(CustomEvent, PointerEventPass) -> Unit

Invoked when a CustomEvent is dispatched by a PointerInputNode.

(CustomEventDispatcher) -> Unit

Invoked right after the PointerInputNode is hit by a pointer during hit testing.

PointerInputHandler

Invoked when pointers that previously hit this PointerInputNode have changed.

Inherited properties

Public constructors

<init>

PointerInputNode()

Backing node for handling pointer events.

Properties

cancelHandler

var cancelHandler: () -> Unit

Invoked to notify the handler that no more calls to pointerInputHandler will be made, until at least new pointers exist. This can occur for a few reasons:

  1. Android dispatches ACTION_CANCEL to AndroidComposeView.onTouchEvent.
  2. The PointerInputNode has been removed from the compose hierarchy.
  3. The PointerInputNode no longer has any descendant LayoutNodes and therefore does not know what region of the screen it should virtually exist in.

customEventHandler

var customEventHandler: (CustomEvent, PointerEventPass) -> Unit

Invoked when a CustomEvent is dispatched by a PointerInputNode.

Dispatch occurs over all passes of PointerEventPass.

The CustomEvent is the event being dispatched. The PointerEventPass is the pass that dispatch is currently on.

initHandler

var initHandler: (CustomEventDispatcher) -> Unit

Invoked right after the PointerInputNode is hit by a pointer during hit testing.

pointerInputHandler

var pointerInputHandler: PointerInputHandler

Invoked when pointers that previously hit this PointerInputNode have changed.