rememberSwipeableState

Composable Function

Android
@Composable
@ExperimentalWearMaterialApi
public fun <T : Any> rememberSwipeableState(
    initialValue: T,
    animationSpec: AnimationSpec<Float> = SwipeableDefaults.AnimationSpec,
    confirmStateChange: (newValue: T) -> Boolean = { true },
): SwipeableState<T>

Create and remember a SwipeableState with the default animation clock.

Parameters

initialValueThe initial value of the state.
animationSpecThe default animation that will be used to animate to a new state.
confirmStateChangeOptional callback invoked to confirm or veto a pending state change.