Lines Matching refs:scene
31 * change of {@link Scene}. To use the manager, add scenes along with
32 * transition objects with calls to {@link #setTransition(Scene, Transition)}
33 * or {@link #setTransition(Scene, Scene, Transition)}. Setting specific
34 * transitions for scene changes is not required; by default, a Scene change
36 * situations. Specifying other transitions for particular scene changes is
44 * that transition to the from/to scene information in that tag.
45 * For example, here is a resource file that declares several scene
52 * creating a scene from a layout in code by calling
53 * {@link Scene#getSceneForLayout(ViewGroup, int, Context)}. For the
72 ArrayMap<Scene, Transition> mSceneTransitions = new ArrayMap<Scene, Transition>();
73 ArrayMap<Scene, ArrayMap<Scene, Transition>> mScenePairTransitions =
74 new ArrayMap<Scene, ArrayMap<Scene, Transition>>();
82 * Sets the transition to be used for any scene change for which no
86 * @param transition The default transition to be used for scene changes.
108 * Sets a specific transition to occur when the given scene is entered.
110 * @param scene The scene which, when applied, will cause the given
112 * @param transition The transition that will play when the given scene is
116 public void setTransition(Scene scene, Transition transition) {
117 mSceneTransitions.put(scene, transition);
124 * @param fromScene The scene being exited when the given transition will
126 * @param toScene The scene being entered when the given transition will
128 * @param transition The transition that will play when the given scene is
132 public void setTransition(Scene fromScene, Scene toScene, Transition transition) {
133 ArrayMap<Scene, Transition> sceneTransitionMap = mScenePairTransitions.get(toScene);
135 sceneTransitionMap = new ArrayMap<Scene, Transition>();
142 * Returns the Transition for the given scene being entered. The result
143 * depends not only on the given scene, but also the scene which the
144 * {@link Scene#getSceneRoot() sceneRoot} of the Scene is currently in.
146 * @param scene The scene being entered
147 * @return The Transition to be used for the given scene change. If no
148 * Transition was specified for this scene change, the default transition
151 private Transition getTransition(Scene scene) {
153 ViewGroup sceneRoot = scene.getSceneRoot();
155 // TODO: cached in Scene instead? long-term, cache in View itself
156 Scene currScene = Scene.getCurrentScene(sceneRoot);
158 ArrayMap<Scene, Transition> sceneTransitionMap = mScenePairTransitions.get(scene);
167 transition = mSceneTransitions.get(scene);
172 * This is where all of the work of a transition/scene-change is
174 * transition, exits the current Scene, enters the new scene, captures
178 * @param scene The scene being entered
179 * @param transition The transition to play for this scene change
181 private static void changeScene(Scene scene, Transition transition) {
183 final ViewGroup sceneRoot = scene.getSceneRoot();
191 Scene oldScene = Scene.getCurrentScene(sceneRoot);
199 scene.enter();
319 // Notify previous scene that it is being exited
320 Scene previousScene = Scene.getCurrentScene(sceneRoot);
327 * Change to the given scene, using the
328 * appropriate transition for this particular scene change
332 * @param scene The Scene to change to
334 public void transitionTo(Scene scene) {
335 // Auto transition if there is no transition declared for the Scene, but there is
337 changeScene(scene, getTransition(scene));
341 * Convenience method to simply change to the given scene using
344 * @param scene The Scene to change to
346 public static void go(Scene scene) {
347 changeScene(scene, sDefaultTransition);
351 * Convenience method to simply change to the given scene using
355 * result in the scene changing without any transition running, and is
356 * equivalent to calling {@link Scene#exit()} on the scene root's
357 * current scene, followed by {@link Scene#enter()} on the scene
358 * specified by the <code>scene</code> parameter.</p>
360 * @param scene The Scene to change to
361 * @param transition The transition to use for this scene change. A
362 * value of null causes the scene change to happen with no transition.
364 public static void go(Scene scene, Transition transition) {
365 changeScene(scene, transition);
370 * to a new scene defined by all changes within the given scene root between
382 * Convenience method to animate to a new scene defined by all changes within
383 * the given scene root between calling this method and the next rendering frame.
385 * scene root and then post a request to run a transition on the next frame.
386 * At that time, the new values in the scene root will be captured and changes
387 * will be animated. There is no need to create a Scene; it is implied by
393 * the same scene root), only the first call will trigger capturing values
394 * and exiting the current scene. Subsequent calls to the method with the
395 * same scene root during the same frame will be ignored.</p>
416 Scene.setCurrentScene(sceneRoot, null);