🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

AnchoredDraggableState

State of the anchoredDraggable modifier.

Source set: Common
public class AnchoredDraggableState<T>(initialValue: T)

State of the anchoredDraggable modifier. Use the constructor overload with anchors if the anchors are defined in composition, or update the anchors using updateAnchors.

This contains necessary information about any ongoing drag or animation and provides methods to change the state either immediately or by starting an animation.

Parameters

initialValue The initial value of the state.

Properties

snapAnimationSpec

Source set: Common
@Deprecated(ConfigurationMovedToModifier, level = DeprecationLevel.WARNING)
    public lateinit var snapAnimationSpec: AnimationSpec<Float>

decayAnimationSpec

Source set: Common
@Deprecated(ConfigurationMovedToModifier, level = DeprecationLevel.WARNING)
    public lateinit var decayAnimationSpec: DecayAnimationSpec<Float>

currentValue

Source set: Common
public var currentValue: T by mutableStateOf(initialValue)

The current value of the AnchoredDraggableState.

That is the closest anchor point that the state has passed through.

settledValue

Source set: Common
public var settledValue: T by mutableStateOf(initialValue)

The value the AnchoredDraggableState is currently settled at.

When progressing through multiple anchors, e.g. A -> B -> C, settledValue will stay the same until settled at an anchor, while currentValue will update to the closest anchor.