← Back to Compose UI
This gesture detector has callbacks for when a press gesture starts and ends for the purposes of displaying visual feedback for those two states.
- 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.
fun Modifier.pressIndicatorGestureFilter( onStart: ((Offset) -> Unit)? = null, onStop: (() -> Unit)? = null, onCancel: (() -> Unit)? = null, enabled: Boolean = true )