Search in sources :

Example 76 with TransitionSet

use of android.transition.TransitionSet in project platform_frameworks_base by android.

the class ChangingText method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.changing_text_1);
    View container = findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.changing_text_2, this);
    mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
    mChanger.addTransition(new ChangeBounds()).addTransition(new ChangeText());
    mCurrentScene = mScene1;
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View)

Example 77 with TransitionSet

use of android.transition.TransitionSet in project platform_frameworks_base by android.

the class ClippingText method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.clipping_text_1);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_2, this);
    mChanger = new TransitionSet().setOrdering(TransitionSet.ORDERING_TOGETHER);
    ChangeBounds changeBounds = new ChangeBounds();
    changeBounds.setResizeClip(true);
    mChanger.addTransition(changeBounds).addTransition(new ChangeText());
    mCurrentScene = mScene1;
}
Also used : ChangeText(android.transition.ChangeText) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View)

Example 78 with TransitionSet

use of android.transition.TransitionSet in project platform_frameworks_base by android.

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 79 with TransitionSet

use of android.transition.TransitionSet in project platform_frameworks_base by android.

the class Demo1 method sendMessage.

public void sendMessage(View view) {
    if (mFirstTime) {
        mFirstTime = false;
        TransitionSet transition = new TransitionSet();
        transition.addTransition(new Fade().addTarget(R.id.resultsText).addTarget(R.id.resultsList)).addTransition(new ChangeBounds().addTarget(R.id.searchContainer));
        mTransitionManager = new TransitionManager();
        mTransitionManager.setTransition(mSearchScreen, transition);
        mTransitionManager.setTransition(mResultsScreen, transition);
    }
    if (mCurrentScene == mResultsScreen) {
        mTransitionManager.transitionTo(mSearchScreen);
        mCurrentScene = mSearchScreen;
    } else {
        mTransitionManager.transitionTo(mResultsScreen);
        mCurrentScene = mResultsScreen;
    }
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) Fade(android.transition.Fade)

Example 80 with TransitionSet

use of android.transition.TransitionSet in project Conductor by bluelinelabs.

the class FabToDialogTransitionChangeHandler method getTransition.

@NonNull
@Override
protected Transition getTransition(@NonNull final ViewGroup container, @Nullable final View from, @Nullable final View to, boolean isPush) {
    Transition backgroundFade = new Fade();
    backgroundFade.addTarget(R.id.dialog_background);
    Transition fabTransform = new FabTransform(ContextCompat.getColor(container.getContext(), R.color.colorAccent), R.drawable.ic_github_face);
    TransitionSet set = new TransitionSet();
    set.addTransition(backgroundFade);
    set.addTransition(fabTransform);
    return set;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) Fade(android.transition.Fade) FabTransform(com.bluelinelabs.conductor.demo.changehandler.transitions.FabTransform) NonNull(android.support.annotation.NonNull)

Aggregations

TransitionSet (android.transition.TransitionSet)127 ChangeBounds (android.transition.ChangeBounds)71 View (android.view.View)66 Transition (android.transition.Transition)57 Fade (android.transition.Fade)47 TransitionManager (android.transition.TransitionManager)32 Recolor (android.transition.Recolor)24 Crossfade (android.transition.Crossfade)20 ViewGroup (android.view.ViewGroup)17 TransitionInflater (android.transition.TransitionInflater)15 ArrayList (java.util.ArrayList)15 ChangeText (android.transition.ChangeText)12 TextView (android.widget.TextView)12 List (java.util.List)10 ImageView (android.widget.ImageView)9 Scene (android.transition.Scene)8 Visibility (android.transition.Visibility)5 GhostView (android.view.GhostView)5 AutoTransition (android.transition.AutoTransition)4 Rotate (android.transition.Rotate)4