# MutableTransform

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/DeferredEnterExitTransition.kt+class:androidx.compose.animation.MutableTransform) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.12.0) Common/AllAndroid/JVM
- Cmn

  ```
  @ExperimentalDeferredTransitionApi
  class MutableTransform
  ```

*** ** * ** ***

An object that allows manual manipulation of the visual transformations (alpha, scale, offset, etc.) of content during the deferred phase (initiated by `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DeferredTransitionState#defer(kotlin.Any)`) of a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DeferredTransition` (e.g., for predictive back gestures).

During the deferred phase, the transition's state is held at its initial value. Properties that are not manually set in the `https://developer.android.com/reference/kotlin/androidx/compose/animation/MutableTransform#update(kotlin.Function2)` block default to the transition's initial value.

Properties in `https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope` are set directly and reflect the manual value for the current frame. They do not automatically animate between values; instead, they should be updated continuously (e.g., in response to gesture progress) to create a smooth manual animation.

The `https://developer.android.com/reference/kotlin/androidx/compose/animation/MutableTransform#update(kotlin.Function2)` lambda is evaluated repeatedly to ensure that state reads (e.g., from gesture progress) are deferred to the layout phase, preventing unnecessary composition churn while keeping Draw-phase operations performant.

Values set in this object are handed off to the automatic transition animation when the deferred phase ends.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/MutableTransform#MutableTransform(kotlin.Boolean,kotlin.Function0,kotlin.Function2)( veilMatchParentSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, offsetVelocityProvider: (() -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)?, block: (https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope.(fullSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/MutableTransform#update(kotlin.Function2)(block: https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope.(fullSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Define the manual transformation to apply during the deferred phase. | Cmn |

## Public constructors

### MutableTransform

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

```
MutableTransform(
    veilMatchParentSize: Boolean = false,
    offsetVelocityProvider: (() -> Offset)? = null,
    block: (TransformScope.(fullSize: IntSize) -> Unit)? = null
)
```

| Parameters |
|---|---|
| `veilMatchParentSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the veil should match the size of the parent. |
| `offsetVelocityProvider: (() -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)? = null` | The velocity of the offset change in pixels/sec. The `https://developer.android.com/reference/kotlin/androidx/compose/animation/MutableTransform#offsetVelocityProvider()` lambda is evaluated exactly once when the deferred phase ends to ensure a seamless handoff to the automatic transition. If `null`, the system will automatically calculate the velocity based on `https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope#offset()` changes during the deferred phase. |
| `block: (https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope.(fullSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | A lambda that applies transformations to the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope`. This block executes dynamically to reflect state changes. |

## Public functions

### update

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

```
fun update(block: TransformScope.(fullSize: IntSize) -> Unit): Unit
```

Define the manual transformation to apply during the deferred phase.

| Parameters |
|---|---|
| `block: https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope.(fullSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | A lambda that applies transformations to the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/TransformScope`. This block executes dynamically to reflect state changes. |