O'Reilly logo

Mastering Android Game Development by Raul Portales

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

Chapter 8. The Animation Framework

Android provides a variety of powerful APIs to apply animation to UI elements. This chapter aims at providing an overview of the options available to help you decide which approach is best for your needs.

Before we start adding animations, we will refactor our code a bit to make the usage of animations easier by creating a callback on our base fragment once the layout has been completed.

Then, we will see how to define a traditional frame-by-frame animations that can be used in an ImageView. We will also see how to incorporate them in our GameEngine in the form of AnimatedSprite.

The core of the chapter is about the different ways to animate views. We will start talking about interpolators and their role in the ...

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