# FrameCallbackScheduler

Artifact: [androidx.dynamicanimation:dynamicanimation](https://developer.android.com/jetpack/androidx/releases/dynamicanimation) [View Source](https://cs.android.com/search?q=file:androidx/dynamicanimation/animation/FrameCallbackScheduler.java+class:androidx.dynamicanimation.animation.FrameCallbackScheduler) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/dynamicanimation#1.1.0)

*** ** * ** ***


```
public interface FrameCallbackScheduler
```

<br />

*** ** * ** ***

A scheduler that runs the given Runnable on the next frame.

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/dynamicanimation/animation/FrameCallbackScheduler#isCurrentThread()()` Returns whether the current thread is the same as the thread that the scheduler is running on. |
| `abstract void` | `https://developer.android.com/reference/androidx/dynamicanimation/animation/FrameCallbackScheduler#postFrameCallback(java.lang.Runnable)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Runnable.html frameCallback)` Callbacks on new frame arrived. |

## Public methods

### isCurrentThread

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/dynamicanimation#1.1.0)

```
abstract boolean isCurrentThread()
```

Returns whether the current thread is the same as the thread that the scheduler is running on.

| Returns |
|---|---|
| `boolean` | true if the scheduler is running on the same thread as the current thread. |

### postFrameCallback

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/dynamicanimation#1.1.0)

```
abstract void postFrameCallback(@NonNull Runnable frameCallback)
```

Callbacks on new frame arrived.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Runnable.html frameCallback` | The runnable of new frame should be posted |