super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
mLoginScene = Scene.getSceneForLayout(mSceneRoot, R.layout.activity_login, this);
mPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout.login_password, this);
mIncorrectPasswordScene = Scene.getSceneForLayout(mSceneRoot, R.layout.incorrect_password, this);
mUsernameTakenScene = Scene.getSceneForLayout(mSceneRoot, R.layout.username_taken, this);
mSuccessScene = Scene.getSceneForLayout(mSceneRoot, R.layout.success, this);
mNewUserScene = Scene.getSceneForLayout(mSceneRoot, R.layout.new_user, this);
mTransitionManager = new TransitionManager();
// Custom transitions in/out of NewUser screen - slide in the 2nd password UI
TransitionSet slider = new TransitionSet();
slider.addTransition(new Slide().addTarget(R.id.retype).addTarget(R.id.retypeEdit));
slider.addTransition(new Recolor().addTarget(R.id.password).
addTarget(R.id.passwordEdit));
slider.addTransition(new Fade());
mTransitionManager.setTransition(mLoginScene, mNewUserScene, slider);
mTransitionManager.setTransition(mPasswordScene, mNewUserScene, slider);
mTransitionManager.setTransition(mNewUserScene, mLoginScene, slider);
mTransitionManager.setTransition(mNewUserScene, mPasswordScene, slider);
// Custom transitions with recoloring password field
Transition colorizer = new Recolor().addTarget(R.id.password).
addTarget(R.id.passwordEdit);
mTransitionManager.setTransition(mLoginScene, mPasswordScene, colorizer);
mTransitionManager.setTransition(mPasswordScene, mLoginScene, colorizer);
mCurrentScene = mLoginScene;