# ResistanceConfig

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

  ```
  class ResistanceConfig
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

Specifies how resistance is calculated in `https://developer.android.com/reference/kotlin/androidx/compose/material/swipeable.modifier#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.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/compose/material/swipeable.modifier#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.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/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/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 |
|---|---|
| `[ResistanceConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#ResistanceConfig(kotlin.Float,kotlin.Float,kotlin.Float))(basis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, factorAtMin: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, factorAtMax: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `[computeResistance](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#computeResistance(kotlin.Float))(overflow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#hashCode())()` **This function is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `[toString](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#toString())()` **This function is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#basis()` **This property is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#factorAtMax()` **This property is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#factorAtMin()` **This property is deprecated.** Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. | Cmn |

## Public constructors

### ResistanceConfig

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

```
[ResistanceConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#ResistanceConfig(kotlin.Float,kotlin.Float,kotlin.Float))(
    basis: Float,
    factorAtMin: Float = StandardResistanceFactor,
    factorAtMax: Float = StandardResistanceFactor
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

| Parameters |
|---|---|
| `basis: 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://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://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

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

```
fun [computeResistance](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#computeResistance(kotlin.Float))(overflow: Float): Float
```

> [!CAUTION]
> **This function is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

### equals

Cmn

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

### hashCode

Cmn

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

### toString

Cmn

```
open fun [toString](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig#toString())(): String
```

> [!CAUTION]
> **This function is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

## Public properties

### basis

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

```
val basis: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

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

### factorAtMax

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

```
val factorAtMax: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

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

### factorAtMin

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

```
val factorAtMin: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

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