Search in sources :

Example 11 with ChangeBounds

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

the class Demo3 method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_screen);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
    mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
    TransitionSet transition = new TransitionSet();
    transition.addTransition(new Fade()).addTransition(new ChangeBounds()).addTransition(new Recolor());
    mTransitionManager = new TransitionManager();
    mTransitionManager.setTransition(mSearchScreen, transition);
    mTransitionManager.setTransition(mResultsScreen, transition);
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade) Recolor(android.transition.Recolor)

Example 12 with ChangeBounds

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

the class Demo4 method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_screen);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
    mResultsScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
    TransitionSet transitionToResults = new TransitionSet();
    Fade fade = new Fade();
    fade.addTarget(R.id.resultsText).addTarget(R.id.resultsList);
    fade.setStartDelay(300);
    fade.setDuration(1000);
    transitionToResults.addTransition(fade).addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).addTransition(new Recolor().addTarget(R.id.container));
    TransitionSet transitionToSearch = new TransitionSet();
    transitionToSearch.addTransition(fade).addTransition(new ChangeBounds().addTarget(R.id.searchContainer)).addTransition(new Recolor().addTarget(R.id.container));
    mTransitionManager = new TransitionManager();
    mTransitionManager.setTransition(mSearchScreen, transitionToSearch);
    mTransitionManager.setTransition(mResultsScreen, transitionToResults);
}
Also used : TransitionManager(android.transition.TransitionManager) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade) Recolor(android.transition.Recolor)

Example 13 with ChangeBounds

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

the class SequenceTestSimple method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fading_test_simple);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    mRemovingButton = (Button) findViewById(R.id.removingButton);
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this);
    TransitionSet fader = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    fader.addTransition(new Fade().addTarget(R.id.removingButton));
    fader.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFade = fader;
    sequencedFadeReverse = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    sequencedFadeReverse.addTransition(new ChangeBounds().addTarget(R.id.sceneSwitchButton));
    sequencedFadeReverse.addTransition(new Fade().addTarget(R.id.removingButton));
    mCurrentScene = mScene1;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) View(android.view.View) Fade(android.transition.Fade)

Example 14 with ChangeBounds

use of android.transition.ChangeBounds in project Material-Animations by lgvalle.

the class AnimationsActivity2 method setupLayout.

private void setupLayout() {
    final ViewGroup activityRoot = (ViewGroup) findViewById(R.id.buttons_group);
    ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.scene_root);
    scene0 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene0, this);
    scene0.setEnterAction(new Runnable() {

        @Override
        public void run() {
            for (int i = 0; i < viewsToAnimate.size(); i++) {
                View child = viewsToAnimate.get(i);
                child.animate().setStartDelay(i * DELAY).scaleX(1).scaleY(1);
            }
        }
    });
    scene0.setExitAction(new Runnable() {

        @Override
        public void run() {
            TransitionManager.beginDelayedTransition(activityRoot);
            View title = scene0.getSceneRoot().findViewById(R.id.scene0_title);
            title.setScaleX(0);
            title.setScaleY(0);
        }
    });
    scene1 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene1, this);
    scene2 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene2, this);
    scene3 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene3, this);
    scene4 = Scene.getSceneForLayout(sceneRoot, R.layout.activity_animations_scene4, this);
    View button1 = findViewById(R.id.sample3_button1);
    button1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            TransitionManager.go(scene1, new ChangeBounds());
        }
    });
    View button2 = findViewById(R.id.sample3_button2);
    button2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            TransitionManager.go(scene2, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds));
        }
    });
    View button3 = findViewById(R.id.sample3_button3);
    button3.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            TransitionManager.go(scene3, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds_sequential));
        }
    });
    View button4 = findViewById(R.id.sample3_button4);
    button4.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            TransitionManager.go(scene4, TransitionInflater.from(AnimationsActivity2.this).inflateTransition(R.transition.slide_and_changebounds_sequential_with_interpolators));
        }
    });
    viewsToAnimate.add(button1);
    viewsToAnimate.add(button2);
    viewsToAnimate.add(button3);
    viewsToAnimate.add(button4);
}
Also used : ViewGroup(android.view.ViewGroup) ChangeBounds(android.transition.ChangeBounds) View(android.view.View)

Example 15 with ChangeBounds

use of android.transition.ChangeBounds in project fresco by facebook.

the class DraweeTransition method createTransitionSet.

public static TransitionSet createTransitionSet(ScalingUtils.ScaleType fromScale, ScalingUtils.ScaleType toScale) {
    TransitionSet transitionSet = new TransitionSet();
    transitionSet.addTransition(new ChangeBounds());
    transitionSet.addTransition(new DraweeTransition(fromScale, toScale));
    return transitionSet;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds)

Aggregations

ChangeBounds (android.transition.ChangeBounds)93 TransitionSet (android.transition.TransitionSet)71 View (android.view.View)54 Fade (android.transition.Fade)46 TransitionManager (android.transition.TransitionManager)28 Crossfade (android.transition.Crossfade)20 Recolor (android.transition.Recolor)20 ViewGroup (android.view.ViewGroup)17 Transition (android.transition.Transition)14 ChangeText (android.transition.ChangeText)12 TextView (android.widget.TextView)9 Scene (android.transition.Scene)8 Button (android.widget.Button)8 ImageView (android.widget.ImageView)7 AutoTransition (android.transition.AutoTransition)5 AdapterView (android.widget.AdapterView)5 LinearLayout (android.widget.LinearLayout)5 ChangeImageTransform (android.transition.ChangeImageTransform)4 ChangeTransform (android.transition.ChangeTransform)4 Rotate (android.transition.Rotate)4