Google is committed to advancing racial equity for Black communities. See how.

SwipeProgress

@Immutable data class SwipeProgress<T>
kotlin.Any
   ↳ androidx.compose.material.SwipeProgress

Collects information about the ongoing swipe or animation in swipeable.

To access this information, use SwipeableState.progress.

Summary

Public constructors
<init>(from: T, to: T, @FloatRange(0.0, 1.0) fraction: Float)

Collects information about the ongoing swipe or animation in swipeable.

Properties
Float

The fraction that the current position represents between from and to.

T

The state corresponding to the anchor we are moving away from.

T

The state corresponding to the anchor we are moving towards.

Public constructors

<init>

SwipeProgress(
    from: T,
    to: T,
    @FloatRange(0.0, 1.0) fraction: Float)

Collects information about the ongoing swipe or animation in swipeable.

To access this information, use SwipeableState.progress.

Parameters
from: T The state corresponding to the anchor we are moving away from.
to: T The state corresponding to the anchor we are moving towards.
fraction: Float The fraction that the current position represents between from and to.

Properties

fraction

val fraction: Float

The fraction that the current position represents between from and to.

from

val from: T

The state corresponding to the anchor we are moving away from.

to

val to: T

The state corresponding to the anchor we are moving towards.