# ResistanceConfig

Artifact: [androidx.wear.compose:compose-material](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material/Swipeable.kt+class:androidx.wear.compose.material.ResistanceConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

<br />

```
@ExperimentalWearMaterialApi
class ResistanceConfig
```

<br />

*** ** * ** ***

Specifies how resistance is calculated in `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/swipeable.modifier#(androidx.compose.ui.Modifier).swipeable(androidx.wear.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.wear.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)`.

There are two things needed to calculate resistance: the resistance basis determines how much overflow will be consumed to achieve maximum resistance, and the resistance factor determines the amount of resistance (the larger the resistance factor, the stronger the resistance).

The resistance basis is usually either the size of the component which `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/swipeable.modifier#(androidx.compose.ui.Modifier).swipeable(androidx.wear.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.wear.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)` is applied to, or the distance between the minimum and maximum anchors. For a constructor in which the resistance basis defaults to the latter, consider using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeableDefaults#resistanceConfig(kotlin.collections.Set,kotlin.Float,kotlin.Float)`.

You may specify different resistance factors for each bound. Consider using one of the default resistance factors in `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeableDefaults`: `StandardResistanceFactor` to convey that the user has run out of things to see, and `StiffResistanceFactor` to convey that the user cannot swipe this right now. Also, you can set either factor to 0 to disable resistance at that bound.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#ResistanceConfig(kotlin.Float,kotlin.Float,kotlin.Float)( basis: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, factorAtMin: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, factorAtMax: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#computeResistance(kotlin.Float)(overflow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#toString()()` |

| ### Public properties |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#basis()` Specifies the maximum amount of overflow that will be consumed. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#factorAtMax()` The factor by which to scale the resistance at the maximum bound. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ResistanceConfig#factorAtMin()` The factor by which to scale the resistance at the minimum bound. |

## Public constructors

### ResistanceConfig

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
ResistanceConfig(
    basis: @FloatRange(from = 0.0, fromInclusive = false) Float,
    factorAtMin: @FloatRange(from = 0.0) Float = StandardResistanceFactor,
    factorAtMax: @FloatRange(from = 0.0) Float = StandardResistanceFactor
)
```

| Parameters |
|---|---|
| `basis: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Specifies the maximum amount of overflow that will be consumed. Must be positive. |
| `factorAtMin: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = StandardResistanceFactor` | The factor by which to scale the resistance at the minimum bound. Must not be negative. |
| `factorAtMax: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = StandardResistanceFactor` | The factor by which to scale the resistance at the maximum bound. Must not be negative. |

## Public functions

### computeResistance

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
fun computeResistance(overflow: Float): Float
```

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### basis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val basis: @FloatRange(from = 0.0, fromInclusive = false) Float
```

Specifies the maximum amount of overflow that will be consumed. Must be positive.

### factorAtMax

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val factorAtMax: @FloatRange(from = 0.0) Float
```

The factor by which to scale the resistance at the maximum bound. Must not be negative.

### factorAtMin

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val factorAtMin: @FloatRange(from = 0.0) Float
```

The factor by which to scale the resistance at the minimum bound. Must not be negative.