by @alexstyl
✉️ Leave your feedback

← Back to Compose UI

pressIndicatorGestureFilter

Modifier
in
Compose UI
. Since 0.1.0-dev15

Overview

Examples

Community Notes

This gesture detector has callbacks for when a press gesture starts and ends for the purposes of displaying visual feedback for those two states.

More specifically:

  • It will call onStart if the first pointer down it receives during the PointerEventPass.Main pass is not consumed.
  • It will call onStop if onStart has been called and the last PointerInputChange it receives during the PointerEventPass.Main pass has an up change, consumed or not, indicating the press gesture indication should end.
  • It will call onCancel if movement has been consumed by the time of the PointerEventPass.Final pass, indicating that the press gesture indication should end because something moved.

This gesture detector always consumes the down change during the PointerEventPass.Main pass.

Overloads

pressIndicatorGestureFilter

fun Modifier.pressIndicatorGestureFilter(
    onStart: ((Offset) -> Unit)? = null,
    onStop: (() -> Unit)? = null,
    onCancel: (() -> Unit)? = null,
    enabled: Boolean = true
)
Next ComponentAndroidView