374 CHAPTER 10: Android Animation: Making Your UI Designs Move
We will be using the first five of these parameters listed, as well as a duration, repeatCount, and
repeatMode parameter to configure our rotate transform in the next section. Since we talked about
all the primary parameters earlier in the chapter, we can get down to business and configure the
rotate transform so we can rotate our Andromeda spaceship!
Rotate Transform: The Configuration Parameters
The first five primary parameters will define the From and To rotation degrees, as well as the pivot
point x and y location and the method of interpolation which will interpret the speed at which the
rotate transform is moved (accelerated or decelerated) over time. In this case, we want a friendship.png
3D spaceship image, that the XML animation definition will eventually be attached to (using Java), to
rotate evenly and smoothly. This is achieved by using “linear” interpolation in Android. The XML
markup for the five initial transform definition parameters are shown in Figure 10-11, and should look
like the following:
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0.0"
android:toDegrees="360.0"
android:pivotX="50%"
android:pivotY="50%"
android:interpolator="@android:anim/linear_interpolator" />
Figure 10-10. Use an android: work process inside the