Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSandeep B
3,558 PointsNow run the transition to the new scene by using a TransitionManager. Use a 'ChangeBounds' transition.
ViewGroup root = (ViewGroup) findViewById(R.id.container); Scene obj = Scene.getSceneForLayout(root, R.layout.transition_scene_2, getContext());
TransitionSet transitionSet = new TransitionSet(); transitionSet.addTransition(new ChangeBounds()); ChangeBounds changeBounds = new ChangeBounds(); transitionSet.addTransition(changeBounds ); TransitionManager.go(changeBounds, transitionSet);
2 Answers
Jess Pendley
13,128 Points```ViewGroup root = (ViewGroup) findViewById(R.id.container);
Scene expandedScene = Scene.getSceneForLayout(root, R.layout.transition_scene_2, this.getContext());
TransitionManager.go(expandedScene, new ChangeBounds());
Patrick Munemo
14,892 PointsViewGroup root = (ViewGroup) findViewById(R.id.container); Scene scene = Scene.getSceneForLayout(root, R.layout.transition_scene_2, getContext());
TransitionManager transitionManager = new TransitionManager(); ChangeBounds changeBounds = new ChangeBounds(); transitionManager.go(newScene, changeBounds);
Karen Fletcher
19,189 PointsKaren Fletcher
19,189 PointsTry: ViewGroup root = (ViewGroup) findViewById(R.id.container); Scene scene = Scene.getSceneForLayout(root, R.layout.transition_scene_2, getContext());
TransitionManager transitionManager = new TransitionManager(); ChangeBounds changeBounds = new ChangeBounds(); transitionManager.go(scene, changeBounds);