# animateIntSizeAsState

Common/All

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize>` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/animation/core/animateIntSizeAsState.composable#animateIntSizeAsState(androidx.compose.ui.unit.IntSize,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)( targetValue: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize, animationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize>, label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, finishedListener: ((https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` Fire-and-forget animation function for `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. | Cmn |

## Functions

### animateIntSizeAsState

Cmn Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/AnimateAsState.kt+function:animateIntSizeAsState)

```
@Composable
fun animateIntSizeAsState(
    targetValue: IntSize,
    animationSpec: AnimationSpec<IntSize> = intSizeDefaultSpring,
    label: String = "IntSizeAnimation",
    finishedListener: ((IntSize) -> Unit)? = null
): State<IntSize>
```

Fire-and-forget animation function for `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. This Composable function is overloaded for different parameter types such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset`, etc. When the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#animateIntSizeAsState(androidx.compose.ui.unit.IntSize,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)` is changed, the animation will run automatically. If there is already an animation in-flight when `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#animateIntSizeAsState(androidx.compose.ui.unit.IntSize,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)` changes, the on-going animation will adjust course to animate towards the new target value.

`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/animateIntSizeAsState.composable#animateIntSizeAsState(androidx.compose.ui.unit.IntSize,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)` returns a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` object. The value of the state object will continuously be updated by the animation until the animation finishes.

Note, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/animateIntSizeAsState.composable#animateIntSizeAsState(androidx.compose.ui.unit.IntSize,androidx.compose.animation.core.AnimationSpec,kotlin.String,kotlin.Function1)` cannot be canceled/stopped without removing this composable function from the tree. See `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Animatable` for cancelable animations.

| Parameters |
|---|---|
| `targetValue: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | Target value of the animation |
| `animationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize> = intSizeDefaultSpring` | The animation that will be used to change the value through time. Physics animation will be used by default. |
| `label: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = "IntSizeAnimation"` | An optional label to differentiate from other animations in Android Studio. |
| `finishedListener: ((https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | An optional end listener to get notified when the animation is finished. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize>` | A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` object, the value of which is updated by animation. |