{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

PressInteraction.Press

public final class PressInteraction.Press implements PressInteraction


An interaction representing a press event on a component.

See also
clickable
PressInteraction.Release
PressInteraction.Cancel

Summary

Public constructors

Press(@NonNull Offset pressPosition)

Public methods

final @NonNull Offset

the Offset describing where this press event occurred within the component.

Public constructors

Press

public Press(@NonNull Offset pressPosition)

Public methods

getPressPosition

public final @NonNull Offset getPressPosition()

the Offset describing where this press event occurred within the component. The Offset can be outside the actual component bounds meaning the Offset can be negative or larger than the component bounds if the touch target is smaller than the ViewConfiguration.minimumTouchTargetSize.