Exploring Android Animations

Are you a designer or a developer who would like to add a fine touch to your android application? Animations can help to create a better mental model of your app and a better understanding of content changes. The android.view.animation package provides a lot of basic animations, but understanding how to use them is not trivial. In this post I am presenting a tool to explore the android animations and to help you to create your own custom animation.

Android provides two mechanisms to create animations: tweened animation and frame-by-frame animation.

Tweened animations consist of a sequence of simple transformations like rotation, scaling, positioning and so on, which could be applied to the content of a View. Those animations are provided by the package android.view.animation.

Frame-by-frame animations, instead, consist in drawing a series of Drawable resources one after the other. Those animations are achieved by the AnimationDrawable class.

In this blog post I am covering only the first type of animations, tweened animations. The other category will be covered in a future blog post.

In the android.view.animation package there are two main classes to look at: Animation, which is an abstraction for an Animation that can be applied to Views, and the AnimationSet which represents a group of Animations that should be played together.

In the same package there are already 4 basic extensions of the Animation class, the AlphaAnimation, the RotateAnimation, the ScaleAnimation and the TranslateAnimations. Their names are self explanatory, however each of them has several parameters that could be configured and it could be difficult to figure-out the configuration more suitable for our purpose. Moreover, things become more complicated when we want to combine more then one Animation type together to achieve particular effects.

For this purpose, I have created a simple tool which allows designer or developer to create their own custom animation by playing with the various parameters offered by the animation API. This tool is available on Google Play and its source code on GitHub.

Here a preview of what you can do with it:

Screen Shot 2016-06-12 at 17.04.05

 Have fun! 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s