A (175)

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


  1. Now you are ready to create the anim_lightship.xml file. The easiest way to
    do this is to copy the tags from the inside of the anim_andromeda.xml
    file and change lunarlander to energyship and change the value for the
    duration parameter to 200 milliseconds, which is 5 FPS (frames per second).
    Copy the eighth frame and paste it three more times underneath itself to
    create the ninth through eleventh frames, as seen in Figure 10-30.


Figure 10-31. Use the left-facing chevron < character inside of the parent tag to open the transforms dialog


Figure 10-30. Create 11 child tags for the frames of the AnimationDrawable and set the duration to 200



  1. Now that the AnimationDrawable object is configured using XML, click on the
    anim_lightshipset.xml tab at the top of Eclipse, and switch over into editing
    the Animation object XML (bootstrap) definition file, shown in Figure 1 0-3 1.
    This Animation object is actually an AnimationSet object, as it uses the parent tag to hold the child transform tags; in this case, these will be a
    and transform as well as an tag.

Free download pdf