Android Transitions

Android Transitions

A tour of the Transitions framework in Android

108056ccba92f98fdbbabad534537573?s=128

Bryan Herbst

February 06, 2016
Tweet

Transcript

  1. 6.

    “In the world of material design, motion describes spatial relationships,

    functionality, and intention with beauty and fluidity.”
  2. 14.

    How it works 1. beginDelayedTransition() => Take a snapshot of

    ViewGroup 2. Update Views 3. On next layout pass, Android takes another snapshot and creates animations
  3. 17.

    Transition types  Fade  Explode  Slide  ChangeBounds

     AutoTransition  Fade  Move  Resize
  4. 21.

    What about property animation? Fine if you want to think

    about Views individually Scenes allow us to think in groups
  5. 33.

    Specifying shared elements makeSceneTransitionAnimation(activity, sharedView, transitionName); We specify pairs of

    Views and transition names. The sharedView is the original view in our current layout (the starting state)
  6. 34.

    Specifying shared elements makeSceneTransitionAnimation(activity, sharedView, transitionName); We specify pairs of

    Views and transition names. The sharedView is the original view in our current layout (the starting state) The viewTransitionName is the name of the corresponding view in the new layout (the ending state)
  7. 64.

    Support for <21 Transition names  android:transitionName="name" is ignored on

    older versions  ViewCompat.setTransitionName(view, “name);
  8. 66.

    Support for <21 Specifying transitions The only place we need

    a version check if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setEnterTransition(new Fade()); }