Summary
Now we have another app-enhancing trick up our sleeves. In this chapter, we saw that animations in Android are quite straightforward. We designed an animation in XML and added the file to the anim
folder. Next, we got a reference to the animation in XML with an Animation
object in our Kotlin code.
We then used a reference to a widget in our UI, set an animation to it using setAnimation
, and passed in the Animation
object. We commenced the animation by calling startAnimation
on the reference to the widget.
We also saw that we can control the timing of animations and listen 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, where we will build a kid's-style drawing app.