FileDocCategorySizeDatePackage
CrossfadeImage.javaAPI DocAndroid 5.1 API2360Thu Mar 12 22:22:44 GMT 2015com.android.transitiontests

CrossfadeImage

public class CrossfadeImage extends android.app.Activity

Fields Summary
android.view.ViewGroup
mSceneRoot
static int
mCurrentScene
android.transition.Scene
mScene1
android.transition.Scene
mScene2
android.transition.TransitionManager
mTransitionManager
boolean
mExpanded
android.transition.Transition
mTransition
android.widget.ImageView
mImageView
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)


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

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

        mImageView = (ImageView) findViewById(R.id.contact_picture);
        mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);

        Crossfade mCrossfade = new Crossfade();
        mCrossfade.addTarget(R.id.contact_picture);

        TransitionSet group = new TransitionSet();
        group.setDuration(1500);
        group.addTransition(mCrossfade).addTransition(new ChangeBounds());
        mTransition = group;
    
public voidsendMessage(android.view.View view)

        TransitionManager.beginDelayedTransition(mSceneRoot, mTransition);
        if (mExpanded) {
            mImageView.setImageResource(R.drawable.self_portrait_square_100);
        } else {
            mImageView.setImageResource(R.drawable.self_portrait_square_200);
        }
        mExpanded = !mExpanded;