PointerInputFilter


A PointerInputFilter represents a single entity that receives PointerInputChanges), interprets them, and consumes the aspects of the changes that it is react to such that other PointerInputFilters don't also react to them.

Summary

Public constructors

Cmn

Public functions

abstract Unit

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

Cmn
abstract Unit
onPointerEvent(
    pointerEvent: PointerEvent,
    pass: PointerEventPass,
    bounds: IntSize
)

Invoked when pointers that previously hit this PointerInputFilter have changed.

Cmn

Public properties

open Boolean

Intercept pointer input that children receive even if the pointer is out of bounds.

Cmn
open Boolean

If false, then this PointerInputFilter will not allow siblings under it to respond to events.

Cmn
IntSize

The layout size assigned to this PointerInputFilter.

Cmn

Public constructors

PointerInputFilter

PointerInputFilter()

Public functions

onCancel

abstract fun onCancel(): Unit

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

  1. Android dispatches ACTION_CANCEL to Compose.

  2. This PointerInputFilter is no longer associated with a LayoutNode.

  3. This PointerInputFilter's associated LayoutNode is no longer in the composition tree.

onPointerEvent

abstract fun onPointerEvent(
    pointerEvent: PointerEvent,
    pass: PointerEventPass,
    bounds: IntSize
): Unit

Invoked when pointers that previously hit this PointerInputFilter have changed. It is expected that any PointerInputChanges that are used during this event and should not be considered valid to be used in other filters should be marked as consumed by calling PointerInputChange.consume.

Parameters
pointerEvent: PointerEvent

The list of PointerInputChanges with positions relative to this PointerInputFilter.

pass: PointerEventPass

The PointerEventPass in which this function is being called.

bounds: IntSize

The width and height associated with this PointerInputFilter.

Public properties

interceptOutOfBoundsChildEvents

open val interceptOutOfBoundsChildEventsBoolean

Intercept pointer input that children receive even if the pointer is out of bounds.

If true, and a child has been moved out of this layout and receives an event, this will receive that event. If false, a child receiving pointer input outside of the bounds of this layout will not trigger any events in this.

shareWithSiblings

open val shareWithSiblingsBoolean

If false, then this PointerInputFilter will not allow siblings under it to respond to events. If true, this will have the first chance to respond and the next sibling under will then get a chance to respond as well. This trigger acts at the Layout level, so if any PointerInputFilters on a Layout has shareWithSiblings set to true then the Layout will share with siblings.

size

val sizeIntSize

The layout size assigned to this PointerInputFilter.