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
@Deprecated(ConfigurationMovedToModifier, level = DeprecationLevel.WARNING)
public lateinit var snapAnimationSpec: AnimationSpec<Float>
decayAnimationSpec
@Deprecated(ConfigurationMovedToModifier, level = DeprecationLevel.WARNING)
public lateinit var decayAnimationSpec: DecayAnimationSpec<Float>
currentValue
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
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.