Swipeable V2State
constructor(initialValue: T, animationSpec: <Error class: unknown class><Float> = SwipeableV2Defaults.AnimationSpec, confirmValueChange: (newValue: T) -> Boolean = { true }, positionalThreshold: <Error class: unknown class>.(totalDistance: Float) -> Float = SwipeableV2Defaults.PositionalThreshold, velocityThreshold: <Error class: unknown class> = SwipeableV2Defaults.VelocityThreshold)
Parameters
initial Value
The initial value of the state.
animation Spec
The default animation that will be used to animate to a new state.
confirm Value Change
Optional callback invoked to confirm or veto a pending state change.
positional Threshold
The positional threshold to be used when calculating the target state while a swipe is in progress and when settling after the swipe ends. This is the distance from the start of a transition. It will be, depending on the direction of the interaction, added or subtracted from/to the origin offset. It should always be a positive value. See the fractionalPositionalThreshold and fixedPositionalThreshold methods.
velocity Threshold
The velocity threshold (in dp per second) that the end velocity has to exceed in order to animate to the next state, even if the positionalThreshold has not been reached.