rememberSwipeToDismissBoxState

Functions summary

SwipeToDismissBoxState
@Composable
rememberSwipeToDismissBoxState(
    animationSpec: AnimationSpec<Float>,
    confirmStateChange: (SwipeToDismissValue) -> Boolean
)

Create a SwipeToDismissBoxState and remember it.

Functions

rememberSwipeToDismissBoxState

@Composable
fun rememberSwipeToDismissBoxState(
    animationSpec: AnimationSpec<Float> = SWIPE_TO_DISMISS_BOX_ANIMATION_SPEC,
    confirmStateChange: (SwipeToDismissValue) -> Boolean = { true }
): SwipeToDismissBoxState

Create a SwipeToDismissBoxState and remember it.

Parameters
animationSpec: AnimationSpec<Float> = SWIPE_TO_DISMISS_BOX_ANIMATION_SPEC

The default animation used to animate to a new state.

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

callback to confirm or veto a pending state change.