Animations in Android
The normal way to create an animation in Android is through XML. We can write XML animations, and then load and play them through our Kotlin code on a specified UI widget. So, for example, we can write an animation that fades in and out five times over three seconds, then play that animation on an ImageView
or any other widget. We can think of these XML animations as a script, as they define the type, order, and timing.
Let's explore some of the different properties we can assign to our animations, how to use them in our Kotlin code, and finally, we can make a neat animations app to try it all out.
Designing cool animations in XML
We have learned that XML can be used to describe animations as well as UI layouts, but let's find out exactly how. We can state values for properties of an animation that describe the starting and ending appearance of a widget. The XML can then be loaded by our Kotlin code by referencing the name of the XML file that contains the...