I created an animation in an xml file. I apply it on a textview like this :
Animation anim = AnimationUtils.loadAnimation(this, R.anim.exit_about);
anim.setRepeatMode(Animation.RESTART);
anim.setRepeatCount(Animation.INFINITE);
v.findViewById(R.id.global_about).startAnimation(anim); // v is my view
This runs once even if I set a repeat count. Any idea ?
XML file saved at res/anim/my_overshoot_interpolator.
These three types of animation fall into two categories: frame animations and tweened animations. Unsurprisingly, frame-base animations are a type of frame animation, whereas View- and Property-based animations are types of tweened animations.
This is odd, I had the same problem, and then I found out about the setRepeatCount and setRepeatMode functions, and implemented them, and then they worked for me fine.
here's my code:
new AnimationUtils();
Animation controller = AnimationUtils.loadAnimation(context, R.anim.flasher);
controller.setRepeatCount(-1);
controller.setRepeatMode(2);
sectionText.startAnimation(controller);
Maybe try reversing the order of your setRepeatCount
and setRepeatMode
functions? Maybe there is something weird going on with your view?
Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50); //You can manage the time
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
Yuor_textview.startAnimation(anim);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With