I run the animation in my Android application using the following code:
RelativeLayout layout = (RelativeLayout) findViewById(R.id.relativeLayout1);
layout.setBackgroundResource(R.drawable.translate);
final TransitionDrawable transition = (TransitionDrawable) layout.getBackground();
transition.startTransition(9000);
The animation runs for 9 seconds, and then it must be canceled.
I am currently using a countdown timer (one already works in the application) to check if 9 seconds have passed and manually canceled the transition.
Is there a better way to do this?
thank
source
share