A (175)

(Tuis.) #1

384 CHAPTER 10: Android Animation: Making Your UI Designs Move


Figure 10-24. Test tween animation in the Galaxy Nexus AVD before (left) and after (right) removing the background



  1. The final thing once we install the correct foreground image (friendship.png)
    and remove the background image is to start the RotateAnimation object
    defined via the tag in the anim_andromeda.xml file by using the
    .startAnimation( ) method call off of the animImageView object. This “wires”
    the ImageView object up to the Animation object using the following line of
    Java code, which is shown (under construction) in Figure 10-23:


animImageView.startAnimation(spaceShipAnim);

As you can see, if you type the animImageView object and a period and the word start, Eclipse
will show you a pop-up helper dialog containing all method calls which are available for that object
which begin with the word start.



  1. Once the three Java statements are in place, use a Run As ➤ Android
    Application menu sequence and test the app in the Galaxy Nexus AVD.
    As you can see in Figure 1 0-2 4 on the right, the new animation
    works perfectly.

Free download pdf