GesturesState

class GesturesState(initialGesturesSettings: GesturesSettings = GesturesSettings { })

A state holder for gesture configuration and gesture event observation.

Obtain an instance through MapState.gesturesState.

Use gesturesSettings to configure which gestures are enabled, and GestureInput to observe individual gesture events in a coroutine-based, lifecycle-aware fashion.

Constructors

Link copied to clipboard
fun GesturesState(initialGesturesSettings: GesturesSettings = GesturesSettings { })

Types

Link copied to clipboard
object Companion

Public companion object of GesturesState.

Functions

Link copied to clipboard
suspend fun gestureInput(block: suspend GestureScope.() -> Unit)

Suspends until the coroutine is canceled, collecting each map attachment and running block with a GestureScope receiver. When the map is replaced or detaches, the current block invocation is canceled and restarted on the new map.

Link copied to clipboard

Returns true if a gesture is currently in progress.

Link copied to clipboard

Returns true if a user-initiated animation is currently in progress.

Properties

Link copied to clipboard

Gesture configuration that controls user touch interaction.

Extensions

Link copied to clipboard
@Composable
fun GesturesState.GestureInput(block: suspend GestureScope.() -> Unit)

Runs block with a GestureScope receiver in a coroutine scoped to the map attachment lifecycle. The coroutine is canceled and restarted whenever the map reattaches.

@Composable
fun GesturesState.GestureInput(key1: Any?, block: suspend GestureScope.() -> Unit)

Runs block with a GestureScope receiver in a coroutine scoped to the map attachment lifecycle. The coroutine is canceled and restarted when key1 or the map changes.

@Composable
fun GesturesState.GestureInput(key1: Any?, key2: Any?, block: suspend GestureScope.() -> Unit)

Runs block with a GestureScope receiver in a coroutine scoped to the map attachment lifecycle. The coroutine is canceled and restarted when key1, key2, or the map changes.

@Composable
fun GesturesState.GestureInput(key1: Any?, key2: Any?, key3: Any?, block: suspend GestureScope.() -> Unit)

Runs block with a GestureScope receiver in a coroutine scoped to the map attachment lifecycle. The coroutine is canceled and restarted when key1, key2, key3, or the map changes.

@Composable
fun GesturesState.GestureInput(vararg keys: Any?, block: suspend GestureScope.() -> Unit)

Runs block with a GestureScope receiver in a coroutine scoped to the map attachment lifecycle. The coroutine is canceled and restarted when any value in keys or the map changes.