remember Anchored Draggable State
fun <T : Any> rememberAnchoredDraggableState(any: Any, initialValue: T, anchors: DraggableAnchors<T>, animationSpec: AnimationSpec<Float> = spring(), positionalThreshold: (distance: Float) -> Float = { it * 0.5f }, velocityThreshold: () -> Float = { 10f }, confirmValueChange: (T) -> Boolean = { true }): AnchoredDraggableState<T>
Parameters
initial Value
初始值
animation Spec
动画spec
positional Threshold
位置阈值,到哪里放手之后就会自动执行动画
velocity Threshold
速度阈值,当速度到达每秒/px的时候就会执行动画,就算位置阈值还没达到
confirm Value Change
根据完成时的值决定是否执行动画,如果是false,那么将复原