Search in sources :

Example 6 with Crossfade

use of android.transition.Crossfade in project android_frameworks_base by DirtyUnicorns.

the class CrossFadeDemo method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade_1, this);
    Crossfade crossfade = new Crossfade();
    crossfade.setFadeBehavior(Crossfade.FADE_BEHAVIOR_CROSSFADE);
    crossfade.setResizeBehavior(Crossfade.RESIZE_BEHAVIOR_NONE);
    crossfade.addTarget(R.id.textview).addTarget(R.id.textview1).addTarget(R.id.textview2);
    mTransitionManager = new TransitionManager();
    TransitionSet moveCrossFade = new TransitionSet();
    moveCrossFade.addTransition(crossfade).addTransition(new ChangeBounds());
    mTransitionManager.setTransition(mScene1, moveCrossFade);
    mTransitionManager.setTransition(mScene2, moveCrossFade);
    mCurrentScene = 1;
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade) View(android.view.View)

Example 7 with Crossfade

use of android.transition.Crossfade in project android_frameworks_base by DirtyUnicorns.

the class CrossfadeImage method onCreate.

@Override
public void onCreate(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;
}
Also used : TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 8 with Crossfade

use of android.transition.Crossfade in project android_frameworks_base by DirtyUnicorns.

the class CrossfadeMultiple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_multiple);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mButton = (Button) findViewById(R.id.button);
    mImageView = (ImageView) findViewById(R.id.imageview);
    mTextView = (TextView) findViewById(R.id.textview);
    mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
    mCrossfadeGroup = new TransitionSet();
    mCrossfadeGroup.setDuration(300);
    mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = mCrossfadeGroup;
    mInOutGroup = new TransitionSet();
    Crossfade inOut = new Crossfade();
    inOut.setDuration(300);
    inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setStartDelay(150);
    changeBounds.setDuration(0);
    mInOutGroup.addTransition(inOut).addTransition(changeBounds);
    mTextChangeGroup1 = new TransitionSet();
    ChangeText changeTextInOut = new ChangeText();
    changeTextInOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    mTextChangeGroup1.addTransition(changeTextInOut).addTransition(new ChangeBounds());
    mTextChangeGroup2 = new TransitionSet();
    mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextOut = new ChangeText();
    changeTextOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT);
    mTextChangeGroup2.addTransition(changeTextOut).addTransition(new ChangeBounds());
    mTextChangeGroup3 = new TransitionSet();
    mTextChangeGroup3.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextIn = new ChangeText();
    changeTextIn.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_IN);
    mTextChangeGroup3.addTransition(changeTextIn).addTransition(new ChangeBounds());
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 9 with Crossfade

use of android.transition.Crossfade in project android_frameworks_base by ResurrectionRemix.

the class CrossfadeMultiple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.crossfade_multiple);
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    mSceneRoot = container;
    mButton = (Button) findViewById(R.id.button);
    mImageView = (ImageView) findViewById(R.id.imageview);
    mTextView = (TextView) findViewById(R.id.textview);
    mCrossfade = new Crossfade();
    mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview);
    mCrossfadeGroup = new TransitionSet();
    mCrossfadeGroup.setDuration(300);
    mCrossfadeGroup.addTransition(mCrossfade).addTransition(new ChangeBounds());
    mTransition = mCrossfadeGroup;
    mInOutGroup = new TransitionSet();
    Crossfade inOut = new Crossfade();
    inOut.setDuration(300);
    inOut.setFadeBehavior(Crossfade.FADE_BEHAVIOR_OUT_IN);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setStartDelay(150);
    changeBounds.setDuration(0);
    mInOutGroup.addTransition(inOut).addTransition(changeBounds);
    mTextChangeGroup1 = new TransitionSet();
    ChangeText changeTextInOut = new ChangeText();
    changeTextInOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    mTextChangeGroup1.addTransition(changeTextInOut).addTransition(new ChangeBounds());
    mTextChangeGroup2 = new TransitionSet();
    mTextChangeGroup2.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextOut = new ChangeText();
    changeTextOut.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT);
    mTextChangeGroup2.addTransition(changeTextOut).addTransition(new ChangeBounds());
    mTextChangeGroup3 = new TransitionSet();
    mTextChangeGroup3.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    ChangeText changeTextIn = new ChangeText();
    changeTextIn.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_IN);
    mTextChangeGroup3.addTransition(changeTextIn).addTransition(new ChangeBounds());
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) Crossfade(android.transition.Crossfade)

Example 10 with Crossfade

use of android.transition.Crossfade in project android_frameworks_base by ResurrectionRemix.

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

Aggregations

ChangeBounds (android.transition.ChangeBounds)20 Crossfade (android.transition.Crossfade)20 TransitionSet (android.transition.TransitionSet)20 View (android.view.View)12 ViewGroup (android.view.ViewGroup)12 ChangeText (android.transition.ChangeText)4 Fade (android.transition.Fade)4 Rotate (android.transition.Rotate)4 Scene (android.transition.Scene)4 TransitionManager (android.transition.TransitionManager)4 LayoutInflater (android.view.LayoutInflater)4 SurfaceView (android.view.SurfaceView)4 TextureView (android.view.TextureView)4 Button (android.widget.Button)4 ImageView (android.widget.ImageView)4 LayoutParams (android.widget.LinearLayout.LayoutParams)4 TextView (android.widget.TextView)4