---
title: "run"
description: "On [R], we don't receive the [onEnd] call when an animation is canceled, so we post the value received in [onApplyWindowInsets] immediately after [onPrepare]."
type: "function"
---
## API Reference

### run

> Source set: Android

```kotlin
override fun run()
```

On `R`, we don't receive the [onEnd](/jetpack-compose/androidx.compose.ui/ui/functions/onEnd/api) call when an animation is canceled, so we post the value
received in [onApplyWindowInsets](/jetpack-compose/androidx.compose.ui/ui/functions/onApplyWindowInsets/api) immediately after `onPrepare`. If [onProgress](/jetpack-compose/androidx.compose.ui/ui/functions/onProgress/api) or [onEnd](/jetpack-compose/androidx.compose.ui/ui/functions/onEnd/api)
is received before the runnable executes then the value won't be used. Otherwise, the
[onApplyWindowInsets](/jetpack-compose/androidx.compose.ui/ui/functions/onApplyWindowInsets/api) value will be used. It may have a janky frame, but it is the best we
can do.
