A (175)

(Tuis.) #1
CHAPTER 10: Android Animation: Making Your UI Designs Move 375

Figure 10-11. The first five primary rotation configuration parameters, and Android interpolator constants


Figure 10-12. Add in the nine-second android:duration parameter, an infinite repeatCount, and a restart repeatMode


Next, define your timing for the rotation by adding an android:rotation parameter set to a value of
9000 , or nine seconds, as shown in Figure 10-12, and define the looping behavior by setting the
repeatCount to “infinite” and the repeatMode to “restart,” which will allow the rotation to loop
seamlessly rather than to pong (a pong, or back and forth animation, would be set by using the
“reverse” constant).


Now that you have defined a rotation transform using the tag and configuration parameters,
you’ll need to reference this RotateAnimation object to the ImageView widget containing the
spaceship you want to rotate.

Free download pdf