# SplineBasedFloatDecayAnimationSpec

# SplineBasedFloatDecayAnimationSpec

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

  ```
  class SplineBasedFloatDecayAnimationSpec : FloatDecayAnimationSpec
  ```

*** ** * ** ***

A native Android fling curve decay.

## Summary

|                                                                                                                                                     ### Public constructors                                                                                                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [SplineBasedFloatDecayAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#SplineBasedFloatDecayAnimationSpec(androidx.compose.ui.unit.Density))`(density: `[Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density)`)` | Cmn |

|                                  ### Public functions                                  |
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `open `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)   | [getDurationNanos](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#getDurationNanos(kotlin.Float,kotlin.Float))`(initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns the duration of the decay animation, in nanoseconds.                                                                                                                            | Cmn |
| `open `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [getTargetValue](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#getTargetValue(kotlin.Float,kotlin.Float))`(initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns the target value of the animation based on the starting condition of the animation ( i.e. start value and start velocity).                                                          | Cmn |
| `open `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [getValueFromNanos](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#getValueFromNanos(kotlin.Long,kotlin.Float,kotlin.Float))`(` ` playTimeNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Returns the value of the animation at the given time.          | Cmn |
| `open `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [getVelocityFromNanos](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#getVelocityFromNanos(kotlin.Long,kotlin.Float,kotlin.Float))`(` ` playTimeNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Returns the velocity of the animation at the given time. | Cmn |

|                                 ### Public properties                                  |
|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `open `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [absVelocityThreshold](https://developer.android.com/reference/kotlin/androidx/compose/animation/SplineBasedFloatDecayAnimationSpec#absVelocityThreshold()) This is the absolute value of a velocity threshold, below which the animation is considered finished. | Cmn |

## Public constructors

### SplineBasedFloatDecayAnimationSpec

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

```
SplineBasedFloatDecayAnimationSpec(density: Density)
```  

|                                              Parameters                                               |
|-------------------------------------------------------------------------------------------------------|------------------------|
| `density: `[Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) | density of the display |

## Public functions

### getDurationNanos

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

```
open fun getDurationNanos(initialValue: Float, initialVelocity: Float): Long
```

Returns the duration of the decay animation, in nanoseconds.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|---------------------------------|
| `initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | start value of the animation    |
| `initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | start velocity of the animation |

### getTargetValue

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

```
open fun getTargetValue(initialValue: Float, initialVelocity: Float): Float
```

Returns the target value of the animation based on the starting condition of the animation ( i.e. start value and start velocity).  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------|
| `initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The start value of the animation    |
| `initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The start velocity of the animation |

### getValueFromNanos

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

```
open fun getValueFromNanos(
    playTimeNanos: Long,
    initialValue: Float,
    initialVelocity: Float
): Float
```

Returns the value of the animation at the given time.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `playTimeNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)     | The time elapsed in milliseconds since the start of the animation |
| `initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The start value of the animation                                  |
| `initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The start velocity of the animation                               |

### getVelocityFromNanos

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

```
open fun getVelocityFromNanos(
    playTimeNanos: Long,
    initialValue: Float,
    initialVelocity: Float
): Float
```

Returns the velocity of the animation at the given time.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `playTimeNanos: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)     | The time elapsed in milliseconds since the start of the animation |
| `initialValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The start value of the animation                                  |
| `initialVelocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The start velocity of the animation                               |

## Public properties

### absVelocityThreshold

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

```
open val absVelocityThreshold: Float
```

This is the absolute value of a velocity threshold, below which the animation is considered finished.