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—making soapy fingers

Wouldn't it be neat if, whenever we touched the Android home screen, a few more bubbles appeared around where our finger touched the screen? Well, that's what we're going to make next!

In the following example, we will see how to register our ability to handle touch events, how to implement the touch event handlers, and how they will appear on the screen.

  1. First of all, we need to extend our BubblesView animation to support adding bubbles interactively. We will do this by implementing a method that can handle MotionEvents and create some extra bubbles.

    Open up BubblesView.java and add the following import:

    import android.view.MotionEvent;
    

    This will allow us to receive motion events from outside.

  2. Next, let us create ...

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