Summary
Now we have another app-enhancing trick up our sleeves. In this chapter, we saw that animations in Android are quite straightforward. We design an animation in XML and add the file to the anim
folder. Next, we get a reference to the animation in XML with an Animation
object in our Java code.
We can then use a reference to a widget in our UI and set an animation to it using setAmimation
and passing in the Animation
object. We commence the animation by calling startAnimation
on the reference to the widget.
We also saw that we can control the timing of animations, as well as listening for animation events.
In the next chapter, we will learn about drawing graphics in Android. This will be the start of several chapters on graphics in which we will build a kid's-style drawing app.