Upgrade to Pro — share decks privately, control downloads, hide ads and more …

android transition framework

bolot
January 16, 2014

android transition framework

bolot

January 16, 2014
Tweet

More Decks by bolot

Other Decks in Programming

Transcript

  1. www.bignerdranch.com XML scene = Scene.getSceneForLayout(sceneRoot, R.layout.scene, this); ! transitionManager =

    inflater .inflateTransitionManager(R.transition.transitions_mgr, sceneRoot); ! transitionManager.transitionTo(scene);
  2. www.bignerdranch.com Scenes & transitions ViewGroup view = inflater.inflate(R.layout.first, container, false);

    Scene scene = new Scene(container, view); Transition transition = createTransition(); TransitionManager.go(scene, transition);
  3. www.bignerdranch.com Customized transitions ChangeBounds changeBounds = new ChangeBounds(); ! Fade

    fadeOut = new Fade(Fade.OUT); Fade fadeIn = new Fade(Fade.IN); ! TransitionSet transition = new TransitionSet() .setOrdering(TransitionSet.ORDERING_SEQUENTIAL) .addTransition(fadeOut) .addTransition(changeBounds) .addTransition(fadeIn); ! TransitionManager.go(scene, transition);
  4. www.bignerdranch.com Customized transitions ChangeBounds changeBounds = new ChangeBounds() .setInterpolator(new AnticipateOvershootInterpolator());

    ! Fade fadeOut = new Fade(Fade.OUT); Fade fadeIn = new Fade(Fade.IN); ! TransitionSet transition = new TransitionSet() .setOrdering(TransitionSet.ORDERING_SEQUENTIAL) .addTransition(fadeOut) .addTransition(changeBounds) .addTransition(fadeIn); ! TransitionManager.go(scene, transition);
  5. www.bignerdranch.com Customized transitions ChangeBounds changeBounds = new ChangeBounds().setDuration(2000) .setInterpolator(new AnticipateOvershootInterpolator());

    ! Fade fadeOut = new Fade(Fade.OUT).setDuration(1000); Fade fadeIn = new Fade(Fade.IN).setDuration(1000); ! TransitionSet transition = new TransitionSet() .setOrdering(TransitionSet.ORDERING_SEQUENTIAL) .addTransition(fadeOut) .addTransition(changeBounds) .addTransition(fadeIn); ! TransitionManager.go(scene, transition);
  6. www.bignerdranch.com More DevBytes: Android 4.4 Transitions video https://www.youtube.com/watch?v=S3H7nJ4QaD8 Transitions backport

    https://github.com/guerwan/TransitionsBackport Sample code & blog post https://github.com/bolot/AndroidTransitionExample http://blog.bignerdranch.com (soon)