Scene

public class Scene
extends Object

java.lang.Object
   ↳ androidx.transition.Scene


A scene represents the collection of values that various properties in the View hierarchy will have when the scene is applied. A Scene can be configured to automatically run a Transition when it is applied, which will animate the various property changes that take place during the scene change.

Summary

Public constructors

Scene(ViewGroup sceneRoot)

Constructs a Scene with no information about how values will change when this scene is applied.

Scene(ViewGroup sceneRoot, View layout)

Constructs a Scene which, when entered, will remove any children from the sceneRoot container and add the layout object as a new child of that container.

Public methods

void enter()

Enters this scene, which entails changing all values that are specified by this scene.

void exit()

Exits this scene, if it is the current scene on the scene's scene root.

static Scene getCurrentScene(ViewGroup sceneRoot)

Gets the current Scene set on the given ViewGroup.

static Scene getSceneForLayout(ViewGroup sceneRoot, int layoutId, Context context)

Returns a Scene described by the resource file associated with the given layoutId parameter.

ViewGroup getSceneRoot()

Gets the root of the scene, which is the root of the view hierarchy affected by changes due to this scene, and which will be animated when this scene is entered.

void setEnterAction(Runnable action)

Scenes that are not defined with layout resources or hierarchies, or which need to perform additional steps after those hierarchies are changed to, should set an enter action, and possibly an exit action as well.

void setExitAction(Runnable action)

Scenes that are not defined with layout resources or hierarchies, or which need to perform additional steps after those hierarchies are changed to, should set an enter action, and possibly an exit action as well.

Inherited methods