I want to add new ListView items with a nice effect. I thought it was simple and convenient, but I messed up the problem:
I want to play the TransitionDrawable animation and rewind it after it is complete. A new item will be drawn for a moment, and then it will mix with the rest.
TransitionDrawable has methods for playing back and forth animations, but none of them can be used for synchronization. I was expecting the opportunity to specify a callback to complete the animation, for example:
TransitionDrawable transition = (TransitionDrawable) view.getBackground(); transition.startTransition(500, new TransitionCompleteListener(){ public void completed() { transition.reverseTransition(500); } });
But nothing of the kind is supported by the TransitionDrawable class.
The problem is this: how to play TransitionDrawable animation, and when it ends - immediately play it back? I had the idea of ββusing the Timer class to delay the execution of the back of the animation, but this solution seems too heavy for such a simple thing.
Or maybe I should use something else that is TransitionDrawable? I would like to avoid using Property Animations since I want to support older devices (and PAs are avaialble with Honeycomb).
android android-ui
user1234567
source share