# ThresholdConfig

# ThresholdConfig

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.ThresholdConfig)  
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  

  ```
  @ExperimentalMaterialApi
  interface ThresholdConfig
```  
Known direct subclasses  
[FixedThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FixedThreshold),[FractionalThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FractionalThreshold)  

|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| [FixedThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FixedThreshold)           | **This class is deprecated.**Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. |
| [FractionalThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FractionalThreshold) | **This class is deprecated.**Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. |

*** ** * ** ***

| **This interface 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.

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

To define a[ThresholdConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/ThresholdConfig), consider using[FixedThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FixedThreshold)and[FractionalThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/FractionalThreshold).

## Summary

|                              ### Public functions                               |
|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density)`.`[computeThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/ThresholdConfig#(androidx.compose.ui.unit.Density).computeThreshold(kotlin.Float,kotlin.Float))`(fromValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, toValue: `[Float](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. | Cmn |

## Public functions

### computeThreshold

Cmn  
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+function:computeThreshold)  
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 Density.computeThreshold(fromValue: Float, toValue: Float): Float
```

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