Working with Animation

One great way to add zing to your splash screen would be to add some animation. The Android platform supports four types of graphics animation:

► Animated GIF images—Animated GIFs are self-contained graphics files with multiple frames.

► Frame-by-frame animation—The Android SDK provides a similar mechanism for frame-by-frame animation in which the developer supplies the individual graphic frames and transitions between them (see the AnimationDrawable class).

► Tweened animation—Tweened animation is a simple and flexible method of defining specific animation operations that can then be applied to any view or layout.

► OpenGL ES—Android's OpenGL ES API provides advanced three-dimensional drawing, animation, lighting, and texturing capabilities.

For your application, the tweened animation makes the most sense. Android provides tweening support for alpha (transparency), rotation, scaling, and translating (moving) animations. You can create sets of animation operations do be done simultaneously, in a timed sequence, and after a delay. Thus, tweened animation is a perfect choice for your splash screen.

With tweened animation, you create an animation sequence, either programmati-cally or by creating animation resources in the /res/anim directory. Each animation sequence needs its own XML file, but the animation may be applied to any number of View controls.

Did you Know?

0 0

Post a comment