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:
- Turn on activity transitions.
- Set transition name values for each shared element view.
- 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.)