A (175)

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

Summary


In this chapter, you learned all about 2D animation concepts and principles, expanding on the 2D
graphics concepts and principles which you learned about in the previous Chapter 9, into the fourth
dimension of time. Changing images over time is the foundation for both 2D animation as well as
digital video media. We will be covering digital video in the next chapter, as a logical follow-on to
subject material you learned in this chapter.


You learned about Android’s AnimationDrawable object and frame-based animation and the
supported digital image formats (PNG) utilized for animation frames. You learned about how to
define frame animation, as well as how to implement it inside your SlidingPaneLayout UI design from
Chapter 8, using the Android ImageView class, which is used to hold Android Drawable objects,
such as images and frame animation XML definitions.


Next, you learned about the Android Animation class, used to implement the other major type
of animation in Android, known as “tween” animation, procedural animation, or vector animation.
Tween animation uses XML tags and parameters to create animation, using alpha blending, scaling,
rotation, and translation (movement).


You learned how to define procedural animation, as well as how to implement it in your
SlidingPaneLayout UI design from Chapter 8, using the Android ImageView class and Animation
class, which you also declared and instantiated in your MainActivity.java Activity subclass to be able
to “wire-up” your procedural animation data to a friendship.png 3D spaceship rendered image that
you made spin slowly within your galaxy.


We finally got around to adding event listeners to the ImageButtons which you created in the
previous chapter, and learned how to add and remove both image assets, or references to these
assets, more accurately, and how to add or remove procedural animation data that you want to
effect the assets using calls to the .setAnimation( ) method call. You learned how to use the null
value in a method call to remove the reference to a media asset, whether that is an image (Drawable
or AnimationDrawable object) or a tween animation (Animation object).


Next, you created hybrid animation, which used both frame animation and procedural animation to
achieve the ultimate animation special effects. You finished up your SlidingPaneLayout by adding
.setText( ) method calls to the three ImageButton event handling structures. Finally, we discussed
basic trade-offs between frame animation’s use of system memory and procedural animation’s use
of CPU processing cycles.


Next, in Chapter11, you’ll learn all about Digital Video in Android, including foundational digital
video theory and concepts, what digital video file formats are best to use in Android, how to create
digital video assets for use with Android’s FrameLayout container class, and how to use the Android
VideoView class and widget. You’ll also learn how that class works with the Android MediaPlayer
class, the Android Uri class and the Android MediaController class.

Free download pdf