FileDocCategorySizeDatePackage
FadingTest.javaAPI DocAndroid 5.1 API2484Thu Mar 12 22:22:44 GMT 2015com.android.transitiontests

FadingTest

public class FadingTest extends android.app.Activity

Fields Summary
android.widget.Button
mRemovingButton
android.widget.Button
mInvisibleButton
android.widget.Button
mGoneButton
android.transition.Scene
mScene1
android.transition.Scene
mScene2
android.view.ViewGroup
mSceneRoot
static android.transition.Fade
sFade
android.transition.Scene
mCurrentScene
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)


     
        sFade.addTarget(R.id.removingButton).addTarget(R.id.invisibleButton).
                addTarget(R.id.goneButton);
    
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fading_test);

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


        mRemovingButton = (Button) findViewById(R.id.removingButton);
        mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
        mGoneButton = (Button) findViewById(R.id.goneButton);

        mGoneButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mGoneButton.setAlpha(mGoneButton.getAlpha() < 1 ? 1 : .6f);
            }
        });

        mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
        mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);

        mCurrentScene = mScene1;
    
public voidsendMessage(android.view.View view)

        if (mCurrentScene == mScene1) {
            TransitionManager.go(mScene2);
            mCurrentScene = mScene2;
        } else {
            TransitionManager.go(mScene1);
            mCurrentScene = mScene1;
        }