Our children's book publisher has come back to us. They thank us kindly for making the ball on the first page roll along correctly, but they are a bit disappointed in page 2. Page 2, if you recall, is a ball that is supposed to bounce.
We'd better fix that now. Let's use a
ValueAnimator to change the padding of the ball in the
ImageView. Look at the following screenshot to see what we're planning:
How the ball-bouncing animation is going to be calculated?
Makes sense? Imagine if, in every frame, we add a little bit to
paddingTop and take a little bit away from
paddingBottom. The ball will fall down!
We can also ...