# Transition.EpicenterCallback

Artifact: [androidx.transition:transition](https://developer.android.com/jetpack/androidx/releases/transition) [View Source](https://cs.android.com/search?q=file:androidx/transition/Transition.java+class:androidx.transition.Transition.EpicenterCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/transition#1.0.0)

*** ** * ** ***


```
public abstract class Transition.EpicenterCallback
```

<br />

*** ** * ** ***

Class to get the epicenter of Transition. Use `https://developer.android.com/reference/androidx/transition/Transition#setEpicenterCallback(androidx.transition.Transition.EpicenterCallback)` to set the callback used to calculate the epicenter of the Transition. Override `https://developer.android.com/reference/androidx/transition/Transition#getEpicenter()` to return the rectangular region in screen coordinates of the epicenter of the transition.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/transition/Transition#setEpicenterCallback(androidx.transition.Transition.EpicenterCallback)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/transition/Transition.EpicenterCallback#EpicenterCallback()()` |

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/transition/Transition.EpicenterCallback#onGetEpicenter(androidx.transition.Transition)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/transition/Transition transition)` Implementers must override to return the epicenter of the Transition in screen coordinates. |

## Public constructors

### EpicenterCallback

Added in 1.0.0

```
public EpicenterCallback()
```

## Public methods

### onGetEpicenter

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

```
public abstract @Nullable Rect onGetEpicenter(@NonNull Transition transition)
```

Implementers must override to return the epicenter of the Transition in screen coordinates. Transitions like `https://developer.android.com/reference/android/transition/Explode.html` depend upon an epicenter for the Transition. In Explode, Views move toward or away from the center of the epicenter Rect along the vector between the epicenter and the center of the View appearing and disappearing. Some Transitions, such as `https://developer.android.com/reference/android/transition/Fade.html` pay no attention to the epicenter.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/transition/Transition transition` | The transition for which the epicenter applies. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Rect.html` | The Rect region of the epicenter of `transition` or null if there is no epicenter. |