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 in Java, on a specified UI widget. So, for example, we can write an animation that fades in and out five times over 3 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, then how to use them in our Java 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 the properties of an animation that describe the starting and ending appearance of a widget. The XML can then be loaded by our Java code by referencing the name of the XML file that contains it and turning...