androidx.compose.ui.input.indirect

Interfaces

IndirectPointerEvent

An IndirectPointerEvent represents a pointer input event, where the pointer positions do not correspond to a position on the screen.

Cmn
IndirectPointerInputModifierNode

A androidx.compose.ui.Modifier.Node that receives IndirectPointerEvents.

Cmn

Classes

IndirectPointerEventPrimaryDirectionalMotionAxis

The primary axis for motion from an IndirectPointerEvent.

Cmn
IndirectPointerEventType

Indicates the reason that the IndirectPointerEvent was sent.

Cmn
IndirectPointerInputChange

Represents a single pointer input change for an indirect pointer event.

Cmn

Top-level functions summary

IndirectPointerEvent
@TestOnly
IndirectPointerEvent(
    changes: List<IndirectPointerInputChange>,
    type: IndirectPointerEventType,
    primaryDirectionalMotionAxis: IndirectPointerEventPrimaryDirectionalMotionAxis,
    motionEvent: MotionEvent
)

Create a IndirectPointerEvent for test use cases.

android

Extension properties summary

MotionEvent

Returns the underlying MotionEvent for additional information and cross module testing.

android

Top-level functions

IndirectPointerEvent

@TestOnly
fun IndirectPointerEvent(
    changes: List<IndirectPointerInputChange>,
    type: IndirectPointerEventType,
    primaryDirectionalMotionAxis: IndirectPointerEventPrimaryDirectionalMotionAxis,
    motionEvent: MotionEvent
): IndirectPointerEvent

Create a IndirectPointerEvent for test use cases. In most cases, you should receive an IndirectPointerEvent from the system through IndirectPointerInputModifierNode.

If you need to test indirect pointer events, use SemanticsNodeInteractionsProvider.sendIndirectPointerInput() where you do not need to manually create IndirectPointerEvents (instead calling higher-level functions).

Parameters
changes: List<IndirectPointerInputChange>

A list of IndirectPointerInputChange associated with the event

type: IndirectPointerEventType

Indicates the reason that the IndirectPointerEvent was sent.

primaryDirectionalMotionAxis: IndirectPointerEventPrimaryDirectionalMotionAxis

Primary directional motion axis for testing.

motionEvent: MotionEvent

The MotionEvent to convert to an IndirectPointerEvent.

Extension properties

IndirectPointerEvent.nativeEvent

val IndirectPointerEvent.nativeEventMotionEvent

Returns the underlying MotionEvent for additional information and cross module testing.