🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Modifier

onRotaryScrollEvent

Adding this modifier to the modifier parameter of a component will allow it to intercept RotaryScrollEvents if it (or one of its children) is focused.

onRotaryScrollEvent

Source set: Common
public fun Modifier.onRotaryScrollEvent(
    onRotaryScrollEvent: (RotaryScrollEvent) -> Boolean
): Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept RotaryScrollEvents if it (or one of its children) is focused.

Here is an example of a scrollable container that scrolls in response to RotaryScrollEvents.

This sample demonstrates how a parent can add an onRotaryScrollEvent modifier to gain access to a RotaryScrollEvent when a child does not consume it:

Parameters

onRotaryScrollEvent This callback is invoked when the user interacts with the rotary side button or the bezel on a wear device. While implementing this callback, return true to stop propagation of this event. If you return false, the event will be sent to this onRotaryScrollEvent's parent.

Return

true if the event is consumed, false otherwise.

Content updated: