# MotionDurationScale

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

  ```
  interface MotionDurationScale : CoroutineContext.Element
  ```

*** ** * ** ***

Provides a duration scale for motion such as animations. When the duration `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` is 0, the motion will end in the next frame callback. Otherwise, the duration `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` will be used as a multiplier to scale the duration of the motion. The larger the scale, the longer the motion will take to finish, and therefore the slower it will be perceived.

## Testing

To control the motion duration scale in tests, create an implementation of this interface and pass it to the `effectContext` parameter either where you call `runComposeUiTest` or where you create your test rule.

## Summary

| ### Nested types |
|---|
| `object https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale.Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-key/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale>` |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-key/index.html<*>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#key()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` Defines the multiplier for the duration of the motion. | Cmn |

### Inherited functions

From [kotlin.coroutines.CoroutineContext](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html) `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/plus.html(context: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html)` Cmn From [kotlin.coroutines.CoroutineContext.Element](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/index.html) `open R` `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/fold.html(initial: R, operation: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/index.html, R) -> R)` Cmn `open operator E?` `<E : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/index.html> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/get.html(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-key/index.html<E>)` Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-element/minus-key.html(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/-key/index.html<*>)` Cmn

## Public properties

### key

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

```
open val key: CoroutineContext.Key<*>
```

### scaleFactor

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

```
val scaleFactor: Float
```

Defines the multiplier for the duration of the motion. This value should be non-negative.

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` of 1.0f would play the motion in real time. 0f would cause motion to finish in the next frame callback. Larger `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` will result in longer durations for the motion/animation (i.e. slower animation). For example, a `https://developer.android.com/reference/kotlin/androidx/compose/ui/MotionDurationScale#scaleFactor()` of 10f would cause an animation with a duration of 100ms to finish in 1000ms.