Luis Borges
Lurker
I'm trying to make an effect on two images, as if it were a flip card annimation. Image 1 = "botaoiniciar" and Image 2 = "botaosair". At the moment when I click on the initial, it turns the second, but then it gets stuck on the second image and I would like it to come back. I am using the following code. I thank you for your attention.
Code:
final ImageView botaoiniciar = (ImageView) findViewById(R.id.botaoiniciar);
botaoiniciar.setOnClickListener(new View.OnClickListener() {
[USER=1021285]@override[/USER]
public void onClick(View view) {
final ObjectAnimator oa1 = ObjectAnimator.ofFloat(botaoiniciar, "scaleX", 1f, 0f);
final ObjectAnimator oa2 = ObjectAnimator.ofFloat(botaoiniciar, "scaleX", 0f, 1f);
oa1.setInterpolator(new DecelerateInterpolator());
oa2.setInterpolator(new AccelerateDecelerateInterpolator());
oa1.addListener(new AnimatorListenerAdapter() {
[USER=1021285]@override[/USER]
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
botaoiniciar.setImageResource(R.drawable.botaosair);
oa2.start();
}
});
oa1.start();
}
});
Last edited by a moderator: