Android 12 Developer Preview is here! Try it out, and give us your feedback!

SwipeProgress

@Immutable 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, fraction: Float)

Collects information about the ongoing swipe or animation in swipeable.

Public methods
Boolean
equals(other: Any?)

Int

String

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,
    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. Must be between 0 and 1.

Public methods

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String

Properties

fraction

val fraction: Float

The fraction that the current position represents between from and to. Must be between 0 and 1.

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.