progress

@FloatRange(from = 0.0, to = 1.0)
fun progress(from: T, to: T): Float

The fraction of the offset between from and to, as a fraction between 0f..1f, or 1f if from is equal to to.

Parameters

from

The starting value used to calculate the distance

to

The end value used to calculate the distance


@get:FloatRange(from = 0.0, to = 1.0)
val progress: Float

Deprecated

Use the progress function to query the progress between two specified anchors.

Replace with

progress(state.settledValue, state.targetValue)

The fraction of the progress going from settledValue to targetValue, within 0f..1f bounds, or 1f if the UnstyledAnchoredDraggableState is in a settled state.