# Transition.EpicenterCallback

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/transition/Transition.EpicenterCallback "View this page in Java")

<br />

```
abstract class Transition.EpicenterCallback
```

<br />

*** ** * ** ***

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

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

## Summary

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

|                                   ### Public functions                                   |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract `[Rect](https://developer.android.com/reference/android/graphics/Rect.html)`?` | [onGetEpicenter](https://developer.android.com/reference/kotlin/androidx/transition/Transition.EpicenterCallback#onGetEpicenter(androidx.transition.Transition))`(transition: `[Transition](https://developer.android.com/reference/kotlin/androidx/transition/Transition)`)` Implementers must override to return the epicenter of the Transition in screen coordinates. |

## Public constructors

### EpicenterCallback

Added in 1.0.0  

```
EpicenterCallback()
```  

## Public functions

### onGetEpicenter

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

```
abstract fun onGetEpicenter(transition: Transition): Rect?
```

Implementers must override to return the epicenter of the Transition in screen coordinates. Transitions like[android.transition.Explode](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[android.transition.Fade](https://developer.android.com/reference/android/transition/Fade.html)pay no attention to the epicenter.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| `transition: `[Transition](https://developer.android.com/reference/kotlin/androidx/transition/Transition) | The transition for which the epicenter applies. |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [Rect](https://developer.android.com/reference/android/graphics/Rect.html)`?` | The Rect region of the epicenter of`transition`or null if there is no epicenter. |