if (mFirstTime) {
mFirstTime = false;
// Non-resource approach of creating scenes
// mSearchScreen = new Scene(this, mSceneRoot, R.layout.search_screen);
// mResultsScreen = new Scene(this, mSceneRoot, R.layout.results_screen);
try {
mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
} catch (Exception e) {
System.out.println("Problem loading scene resource: " + e);
}
TransitionSet transition = new TransitionSet();
transition.addTransition(new Fade().addTarget(R.id.resultsText).
addTarget(R.id.resultsList)).
addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).
addTransition(new Recolor().addTarget(R.id.container));
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mSearchScreen, transition);
mTransitionManager.setTransition(mResultsScreen, transition);
}
if (mCurrentScene == mResultsScreen) {
mTransitionManager.transitionTo(mSearchScreen);
mCurrentScene = mSearchScreen;
} else {
mTransitionManager.transitionTo(mResultsScreen);
mCurrentScene = mResultsScreen;
}