Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

View animation


The original and simpler way of animating views in Android is to use view animation. This creates an Animation object either by loading it from XML or programmatically, which is then applied to the view. They are relatively easy to set up and offer enough capabilities to meet most needs.

There are some important details about view animations. They are as follows:

  • When we animate a view, all the children of the view are affected as well.

  • Regardless of how your animation may move or resize, the bounds of the view that is animated will not automatically adjust to accommodate it. Even so, the animation will still be drawn beyond the bounds of its view and will not be clipped. However, clipping will occur if the animation exceeds the bounds of the parent view. This can be fixed by setting clipChildren to false in the parent view.

  • The views will return to their original state once the animation is completed. If you plan to use this type of animations to reveal or hide a view, you must...