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 an everlasting tween

At the moment, the user has no visual clue as to whether he/she has clicked a start block yet. Perhaps he/she got distracted and can't remember which block he/she touched last.

Let's add a new animation which makes the from tower glow gently, that is, the tower from which the block will be taken. When our user selects a destination tower, the move operation will be complete and we can stop the pulsing animation.

  1. Create a new XML file in res/anim called tower_glow.xml. This is going to be the animation that we apply to the selected tower.
  2. In this new file, add the following XML:
    <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="1" ...

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