SwipeableState
open class SwipeableState<T>(initialValue: T, animationSpec: AnimationSpec<Float> = AnimationSpec, val confirmStateChange: (newValue: T) -> Boolean = { true })
State of the swipeable modifier.
This contains necessary information about any ongoing swipe or animation and provides methods to change the state either immediately or by starting an animation. To create and remember a SwipeableState with the default animation clock, use rememberSwipeableState.
Parameters
initialValue
The initial value of the state.
animationSpec
The default animation that will be used to animate to a new state.
confirmStateChange
Optional callback invoked to confirm or veto a pending state change.
Constructors
Link copied to clipboard
constructor(initialValue: T, animationSpec: AnimationSpec<Float> = AnimationSpec, confirmStateChange: (newValue: T) -> Boolean = { true })