# BoundsTransform

# BoundsTransform

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

  ```
  fun interface BoundsTransform
  ```

*** ** * ** ***

[BoundsTransform](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform)defines the animation spec used to animate from initial bounds to the target bounds.

## Summary

|                                                                                                  ### Public functions                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [FiniteAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec)`<`[Rect](https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect)`>` | [createAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform#createAnimationSpec(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect))`(initialBounds: `[Rect](https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect)`, targetBounds: `[Rect](https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect)`)` Returns a[FiniteAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec)for animating the bounds from[initialBounds](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform#createAnimationSpec(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect))to[targetBounds](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform#createAnimationSpec(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)). | Cmn |

## Public functions

### createAnimationSpec

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

```
fun createAnimationSpec(initialBounds: Rect, targetBounds: Rect): FiniteAnimationSpec<Rect>
```

Returns a[FiniteAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec)for animating the bounds from[initialBounds](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform#createAnimationSpec(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect))to[targetBounds](https://developer.android.com/reference/kotlin/androidx/compose/animation/BoundsTransform#createAnimationSpec(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)).