Animation demo app – introducing SeekBar
That's enough theory, especially with something that should be visual. Let's build an animation demo app that explores everything we have just discussed and a bit more.
This app involves small amounts of code in lots of different files. Therefore, I have tried to make it plain which code is in which file, so you can keep track of what is going on. This will make the Java we write for this app more understandable as well.
The app will demonstrate rotations, fades, translations, animation events, interpolations, and controlling duration with a SeekBar
widget. The best way to explain what the SeekBar
widget does is to build it and then watch it in action.
Laying out the animation demo
Create a new project called Animation Demo
using the Empty Activity template, leaving all the other settings at their defaults. As usual, should you wish to speed things up by copy and pasting the layout, the Java code, or the animation...