Android Property Animation

by keen
  • Using animations in Android application - Tutorial

    Android 3.0 introduced the Properties Animation API which allow to change object properties over a predefined time interval.

    The API allows to define for arbitrary object properties a start and end value and apply a time-based change to this attribute. This API can be applied on any Java object not only on Views...

  • Building Animations with the android.transition Framework, Part 1

    With KitKat, Google brought a number of welcome additions to Android. Today, we’ll focus on one of them, the android.transition framework. Over the years, Android has gradually improved the animation tools available to developers. Property animations introduced in Honeycomb provide a fantastic API for creating rich and complex animations. In KitKat, android.transition builds on top of that and makes it possible to define animations in a more declarative manner...

  • Building Animations with the android.transition Framework, Part 2

    In the previous post, we took a first look at the [android.transition](http://developer.android.com/reference/android/transition/package-summary.html) framework and started following the evolution of our AndroidTransitionExample project. In this post, we’ll continue our exploration by learning how to control transitions and how to load them from XML files. ..

  • Property Animation : Introduction

    The View Animation System allowed you to simply animate changes in the appearance of a View element. The View Animation system was simple but it was also quite limited. Only a few basic transformations are supported by the system, the scale, translation and rotation transformation and the alpha property that allows you animate the transparency of a View. For some situations this might be sufficient but in many cases the View Animation System is too restrictive...

  • Property Animation : Programming Animation

    In the previous post on property animations I introduced the ObjectAnimator to create animations on arbitrary properties on objects. The only restriction is that the object must define a setter method for the property that should be animated. ObjectAnimator extends the abstract Animator class which forms the basis of the Property Animation System. The system defines three other Animator classes, the AnimatorSet, the ValueAnimator and the TimeAnimator. In practice you will rarely have the need for the latter two and the ObjectAnimator together with the AnimatorSet should be sufficient. In this post I will show you how to programmatically create animations using these two classes. The ValueAnimator and the TimeAnimator will be the topic of a later post...

  • Property Animation : Building Complex Animation

    The Animation Set allows you to choreograph a number of animations to play in parallel and in sequence. This gives you a great degree of artistic freedom. It also means that the standard API can get somewhat confusing if you want to programmatically create a complex animation set. To make things easier Android provides the AnimatorSet.Builder class that assists you in creating a complex Animation Set. As the name suggests, the Builder class implements the classic builder software design pattern but it does so in a slightly different way than you might be used to. A Builder cannot be created directly without an AnimatorSet object. Instead you need to create an empty AnimatorSet and then create a Builder by calling AnimatorSet.play. The Builder will then add animations to the set. It will also set the parameters so that animations are timed correctly and played in the right order. Using the Builder is comparatively easy and makes the code manageable even for complex animations...

  • Property Animation : Evaluators

    Until now we have been animating float or int properties only. The Property Animation System is, however, not limited to only simple numeric types. Out of the box, you can also animate ARGB colours and Rect objects by using the ArgbEvaluator and the RectEvaluator classes. In fact, you can animate any kind of object if you write your own evaluator class. In this post I will be showing a few examples and explain how to use evaluators to animate other object types. To provide examples, I will create two evaluators. The first will animate between two Matrix transformations. The second will animate between two colours using the HSV colour model...

  • Property Animation : Controlling Animation Flow

    Using the Animator API you can start, stop and cancel animations. A little reported addition in the Kitkat API level 19 allows you to also pause and resume animations. In this post I will take you through the animation flow controls and some methods that let you inspect the status of the animation...

  • Property Animation : Animator Listeners

    Animator listeners provide a powerful tool to monitor the state of animation. The animation listener implements the classic observer design pattern. The Animator.AnimatorListener interface defines a number of methods that need to be implemented. Any number of listeners can register with an animation. Whenever the state of the animation changes all listeners are notified through calling the respective callback methods...