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

SwipeableConstants

object SwipeableConstants
kotlin.Any
   ↳ androidx.compose.material.SwipeableConstants

Contains useful constants for swipeable and SwipeableState.

Summary

Constants
const Float

A standard resistance factor which indicates that the user has run out of things to see.

const Float

A stiff resistance factor which indicates that swiping isn't available right now.

Public methods
ResistanceConfig?
defaultResistanceConfig(anchors: Set<Float>, factorAtMin: Float = StandardResistanceFactor, factorAtMax: Float = StandardResistanceFactor)

The default resistance config used by swipeable.

Properties
SpringSpec<Float>

The default animation used by SwipeableState.

Dp

The default velocity threshold (1.

Constants

StandardResistanceFactor

const val StandardResistanceFactor: Float

A standard resistance factor which indicates that the user has run out of things to see.

Value: 10f

StiffResistanceFactor

const val StiffResistanceFactor: Float

A stiff resistance factor which indicates that swiping isn't available right now.

Value: 20f

Public methods

defaultResistanceConfig

fun defaultResistanceConfig(
    anchors: Set<Float>,
    factorAtMin: Float = StandardResistanceFactor,
    factorAtMax: Float = StandardResistanceFactor
): ResistanceConfig?

The default resistance config used by swipeable.

This returns null if there is one anchor. If there are at least two anchors, it returns a ResistanceConfig with the resistance basis equal to the distance between the two bounds.

Properties

DefaultAnimationSpec

val DefaultAnimationSpec: SpringSpec<Float>

The default animation used by SwipeableState.

DefaultVelocityThreshold

val DefaultVelocityThreshold: Dp

The default velocity threshold (1.8 dp per millisecond) used by swipeable.