Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Chapter 35  Material Design


Beginning in Lollipop, Android provides techniques for accomplishing a transition between activities
or between fragments. Here, we will show you how it works with activities. The middle of the
animation looks like Figure 35.8.


Figure 35.8  Shared element transition


For activities, the basic implementation is a three-step process:



  1. Turn on activity transitions.

  2. Set transition name values for each shared element view.

  3. Start your next activity with an ActivityOptions that will trigger the transition.


First, you have to turn on activity transitions. If your activity uses the AppCompat theme used
elsewhere in the book, then you can skip this step. (AppCompat inherits from the Material theme,
which turns on activity transitions for you.)

Free download pdf