Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/transition/TransitionManager#pubctors) \| [Methods](https://developer.android.com/reference/android/transition/TransitionManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/transition/TransitionManager#inhmethods)

# TransitionManager

*** ** * ** ***


`
public


class
TransitionManager
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.transition.TransitionManager |

<br />

*** ** * ** ***

This class manages the set of transitions that fire when there is a
change of `https://developer.android.com/reference/android/transition/Scene`. To use the manager, add scenes along with
transition objects with calls to `https://developer.android.com/reference/android/transition/TransitionManager#setTransition(android.transition.Scene,%20android.transition.Transition)`
or `https://developer.android.com/reference/android/transition/TransitionManager#setTransition(android.transition.Scene,%20android.transition.Scene,%20android.transition.Transition)`. Setting specific
transitions for scene changes is not required; by default, a Scene change
will use `https://developer.android.com/reference/android/transition/AutoTransition` to do something reasonable for most
situations. Specifying other transitions for particular scene changes is
only necessary if the application wants different transition behavior
in these situations.

TransitionManagers can be declared in XML resource files inside the
`res/transition` directory. TransitionManager resources consist of
the `transitionManager`tag name, containing one or more
`transition` tags, each of which describe the relationship of
that transition to the from/to scene information in that tag.
For example, here is a resource file that declares several scene
transitions:

```
<transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
    <transition android:fromScene="@layout/transition_scene1"
                android:toScene="@layout/transition_scene2"
                android:transition="@transition/changebounds"/>
    <transition android:fromScene="@layout/transition_scene2"
                android:toScene="@layout/transition_scene1"
                android:transition="@transition/changebounds"/>
    <transition android:toScene="@layout/transition_scene3"
                android:transition="@transition/changebounds_fadein_together"/>
    <transition android:fromScene="@layout/transition_scene3"
                android:toScene="@layout/transition_scene1"
                android:transition="@transition/changebounds_fadeout_sequential"/>
    <transition android:fromScene="@layout/transition_scene3"
                android:toScene="@layout/transition_scene2"
                android:transition="@transition/changebounds_fadeout_sequential"/>
</transitionManager>
```

For each of the `fromScene` and `toScene` attributes,
there is a reference to a standard XML layout file. This is equivalent to
creating a scene from a layout in code by calling
`https://developer.android.com/reference/android/transition/Scene#getSceneForLayout(android.view.ViewGroup,%20int,%20android.content.Context)`. For the
`transition` attribute, there is a reference to a resource
file in the `res/transition` directory which describes that
transition.
Information on XML resource descriptions for transitions can be found for `https://developer.android.com/reference/android/R.styleable#Transition`, `https://developer.android.com/reference/android/R.styleable#TransitionSet`, `https://developer.android.com/reference/android/R.styleable#TransitionTarget`, `https://developer.android.com/reference/android/R.styleable#Fade`, and `https://developer.android.com/reference/android/R.styleable#TransitionManager`.

<br />

## Summary

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

| ### Public methods ||
|---|---|
| ` static void` | ` https://developer.android.com/reference/android/transition/TransitionManager#beginDelayedTransition(android.view.ViewGroup,%20android.transition.Transition)(https://developer.android.com/reference/android/view/ViewGroup sceneRoot, https://developer.android.com/reference/android/transition/Transition transition) ` Convenience method to animate to a new scene defined by all changes within the given scene root between calling this method and the next rendering frame. |
| ` static void` | ` https://developer.android.com/reference/android/transition/TransitionManager#beginDelayedTransition(android.view.ViewGroup)(https://developer.android.com/reference/android/view/ViewGroup sceneRoot) ` Convenience method to animate, using the default transition, to a new scene defined by all changes within the given scene root between calling this method and the next rendering frame. |
| ` static void` | ` https://developer.android.com/reference/android/transition/TransitionManager#endTransitions(android.view.ViewGroup)(https://developer.android.com/reference/android/view/ViewGroup sceneRoot) ` Ends all pending and ongoing transitions on the specified scene root. |
| ` static void` | ` https://developer.android.com/reference/android/transition/TransitionManager#go(android.transition.Scene,%20android.transition.Transition)(https://developer.android.com/reference/android/transition/Scene scene, https://developer.android.com/reference/android/transition/Transition transition) ` Convenience method to simply change to the given scene using the given transition. |
| ` static void` | ` https://developer.android.com/reference/android/transition/TransitionManager#go(android.transition.Scene)(https://developer.android.com/reference/android/transition/Scene scene) ` Convenience method to simply change to the given scene using the default transition for TransitionManager. |
| ` void` | ` https://developer.android.com/reference/android/transition/TransitionManager#setTransition(android.transition.Scene,%20android.transition.Transition)(https://developer.android.com/reference/android/transition/Scene scene, https://developer.android.com/reference/android/transition/Transition transition) ` Sets a specific transition to occur when the given scene is entered. |
| ` void` | ` https://developer.android.com/reference/android/transition/TransitionManager#setTransition(android.transition.Scene,%20android.transition.Scene,%20android.transition.Transition)(https://developer.android.com/reference/android/transition/Scene fromScene, https://developer.android.com/reference/android/transition/Scene toScene, https://developer.android.com/reference/android/transition/Transition transition) ` Sets a specific transition to occur when the given pair of scenes is exited/entered. |
| ` void` | ` https://developer.android.com/reference/android/transition/TransitionManager#transitionTo(android.transition.Scene)(https://developer.android.com/reference/android/transition/Scene scene) ` Change to the given scene, using the appropriate transition for this particular scene change (as specified to the TransitionManager, or the default if no such transition exists). |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### TransitionManager

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TransitionManager ()
```

<br />

<br />

## Public methods

### beginDelayedTransition

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void beginDelayedTransition (ViewGroup sceneRoot, 
                Transition transition)
```

Convenience method to animate to a new scene defined by all changes within
the given scene root between calling this method and the next rendering frame.
Calling this method causes TransitionManager to capture current values in the
scene root and then post a request to run a transition on the next frame.
At that time, the new values in the scene root will be captured and changes
will be animated. There is no need to create a Scene; it is implied by
changes which take place between calling this method and the next frame when
the transition begins.

Calling this method several times before the next frame (for example, if
unrelated code also wants to make dynamic changes and run a transition on
the same scene root), only the first call will trigger capturing values
and exiting the current scene. Subsequent calls to the method with the
same scene root during the same frame will be ignored.

Passing in `null` for the transition parameter will
cause the TransitionManager to use its default transition.

<br />

<br />

| Parameters ||
|---|---|
| `sceneRoot` | `ViewGroup`: The root of the View hierarchy to run the transition on. <br /> |
| `transition` | `Transition`: The transition to use for this change. A value of null causes the TransitionManager to use the default transition. <br /> |

### beginDelayedTransition

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void beginDelayedTransition (ViewGroup sceneRoot)
```

Convenience method to animate, using the default transition,
to a new scene defined by all changes within the given scene root between
calling this method and the next rendering frame.
Equivalent to calling `https://developer.android.com/reference/android/transition/TransitionManager#beginDelayedTransition(android.view.ViewGroup,%20android.transition.Transition)`
with a value of `null` for the `transition` parameter.

<br />

| Parameters ||
|---|---|
| `sceneRoot` | `ViewGroup`: The root of the View hierarchy to run the transition on. <br /> |

### endTransitions

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void endTransitions (ViewGroup sceneRoot)
```

Ends all pending and ongoing transitions on the specified scene root.

<br />

| Parameters ||
|---|---|
| `sceneRoot` | `ViewGroup`: The root of the View hierarchy to end transitions on. <br /> |

### go

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void go (Scene scene, 
                Transition transition)
```

Convenience method to simply change to the given scene using
the given transition.

Passing in `null` for the transition parameter will
result in the scene changing without any transition running, and is
equivalent to calling `https://developer.android.com/reference/android/transition/Scene#exit()` on the scene root's
current scene, followed by `https://developer.android.com/reference/android/transition/Scene#enter()` on the scene
specified by the `scene` parameter.

<br />

<br />

| Parameters ||
|---|---|
| `scene` | `Scene`: The Scene to change to <br /> |
| `transition` | `Transition`: The transition to use for this scene change. A value of null causes the scene change to happen with no transition. <br /> |

### go

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void go (Scene scene)
```

Convenience method to simply change to the given scene using
the default transition for TransitionManager.

<br />

| Parameters ||
|---|---|
| `scene` | `Scene`: The Scene to change to <br /> |

### setTransition

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTransition (Scene scene, 
                Transition transition)
```

Sets a specific transition to occur when the given scene is entered.

<br />

| Parameters ||
|---|---|
| `scene` | `Scene`: The scene which, when applied, will cause the given transition to run. <br /> |
| `transition` | `Transition`: The transition that will play when the given scene is entered. A value of null will result in the default behavior of using the default transition instead. <br /> |

### setTransition

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTransition (Scene fromScene, 
                Scene toScene, 
                Transition transition)
```

Sets a specific transition to occur when the given pair of scenes is
exited/entered.

<br />

| Parameters ||
|---|---|
| `fromScene` | `Scene`: The scene being exited when the given transition will be run <br /> |
| `toScene` | `Scene`: The scene being entered when the given transition will be run <br /> |
| `transition` | `Transition`: The transition that will play when the given scene is entered. A value of null will result in the default behavior of using the default transition instead. <br /> |

### transitionTo

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void transitionTo (Scene scene)
```

Change to the given scene, using the
appropriate transition for this particular scene change
(as specified to the TransitionManager, or the default
if no such transition exists).

<br />

| Parameters ||
|---|---|
| `scene` | `Scene`: The Scene to change to <br /> |