FileDocCategorySizeDatePackage
ResourceLoadingTest.javaAPI DocAndroid 5.1 API2855Thu Mar 12 22:22:44 GMT 2015com.android.transitiontests

ResourceLoadingTest

public class ResourceLoadingTest extends android.app.Activity

Fields Summary
private static final int
SEARCH_SCREEN
private static final int
RESULTS_SCREEN
android.view.ViewGroup
mSceneRoot
static int
mCurrentScene
android.transition.TransitionManager
mTransitionManager
android.transition.TransitionInflater
mInflater
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)


    
        
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search_screen);

        View container = (View) findViewById(R.id.container);
        mSceneRoot = (ViewGroup) container.getParent();

        mCurrentScene = SEARCH_SCREEN;

        mInflater = TransitionInflater.from(this);
    
public voidsendMessage(android.view.View view)

        if (mTransitionManager == null) {
            try {
                TransitionInflater inflater = TransitionInflater.from(this);
                mTransitionManager =
                        inflater.inflateTransitionManager(R.transition.my_transition_mgr,
                                mSceneRoot);
                Scene loadedScene = new Scene(mSceneRoot);
                System.out.println("loadedScene = " + loadedScene);
                Transition loadedTransition = inflater.inflateTransition(R.transition.my_transition);
                System.out.println("loadedTransition = " + loadedTransition);
            } catch (Exception e) {
                System.out.println("Problem loading scene resource: " + e);
            }
        }
        if (mCurrentScene == RESULTS_SCREEN) {
            Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
            mTransitionManager.transitionTo(scene);
            mCurrentScene = SEARCH_SCREEN;
        } else {
            Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
            mTransitionManager.transitionTo(scene);
            mCurrentScene = RESULTS_SCREEN;
        }