Time for action - writing a custom animation

Writing a custom animation is very simple, but not entirely intuitive. For this section you'll define a custom animation which will increase the size of its animated widget by a factor of five, while at the same time fading it until its entirely transparent.

  1. Create a new XML resource file named res/anim/vanish.xml and open it in an editor or IDE.
  2. The root element of the animation file will be an animation set element:
    <set xmlns:android="http://schemas.android.com/apk/res/android">
  3. In the<set> element, declare an element to define the scale up animation:
    <scale />
  4. The duration of the scale up animation needs to be set as 300 milliseconds:
  5. The animation starts to scale from the original ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.