Tuesday 23 June 2015

Issues with Animators


What are animators ? Why do we need them ? What is the difference with the conventional view animations ? How animators are implemented in android ?


Well today in this post I will not talk about these, instead I will put light on some issues that I faced while working and came to know about the reason very late.

The main issues that I noticed are :

1. I cannot reuse an ObjectAnimator and AnimatorSet object to get it usable for multiple views.
2. I cannot clear animation from my view. I mean resetting the view to its original position.

So after delving deeply into the android developer docs I reached to the following solutions at the time of writing :

1. Clone the create ObjectAnimator and AnimatorSet object to create a completely different copy of that object which could be used easily with a new view.
2. To get the reset functionality for animator set, we should be creating an animator that animates the same property to back to its original state(reverse action of the animator).


Please comment in case of issues :

No comments:

Post a Comment