# ThresholdConfig

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.ThresholdConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)


```
@ExperimentalWearMaterialApi
interface ThresholdConfig
```

<br />

Known direct subclasses [FixedThreshold](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FixedThreshold), [FractionalThreshold](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FractionalThreshold)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FixedThreshold` | A fixed threshold will be at an `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FixedThreshold#(androidx.compose.ui.unit.Dp)` away from the first anchor. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FractionalThreshold` | A fractional threshold will be at a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FractionalThreshold#(kotlin.Float)` of the way between the two anchors. |

*** ** * ** ***

Interface to compute a threshold between two anchors/states in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/package-summary#(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)`.

To define a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ThresholdConfig`, consider using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FixedThreshold` and `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/FractionalThreshold`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density.https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ThresholdConfig#(androidx.compose.ui.unit.Density).computeThreshold(kotlin.Float,kotlin.Float)(fromValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, toValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Compute the value of the threshold (in pixels), once the values of the anchors are known. |

## Public functions

### computeThreshold

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+function:computeThreshold) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
fun Density.computeThreshold(fromValue: Float, toValue: Float): Float
```

Compute the value of the threshold (in pixels), once the values of the anchors are known.