O'Reilly logo

Android 3.0 Animations by Alex Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—creating a tween in Java

We want to make a new animation to replace slidein.xml. This time, we want our pages to come in from the right, as before, but we will add a scale animation too, to make it look more exciting. It will be as if the page is being pulled from a tall stack of pages, just out of view.

But we're bored of XML. Don't ask me why, perhaps it's because of all those pointy brackets. Give us the round parentheses of Java, we say! We will use the Java equivalent of the XML tags for<set>, <translate>, and<scale> animations.

  1. Open up InteractiveBook.java and add the following import lines:
    import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.ScaleAnimation; import ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required