rememberSwipeableState

Functions summary

SwipeableState<T>
@Composable
@ExperimentalMaterialApi
<T : Any> rememberSwipeableState(
    initialValue: T,
    animationSpec: AnimationSpec<Float>,
    confirmStateChange: (newValue) -> Boolean
)

This function is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn

Functions

rememberSwipeableState

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

Create and remember a SwipeableState with the default animation clock.

Parameters
initialValue: T

The initial value of the state.

animationSpec: AnimationSpec<Float> = AnimationSpec

The default animation that will be used to animate to a new state.

confirmStateChange: (newValue) -> Boolean = { true }

Optional callback invoked to confirm or veto a pending state change.