<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:propertyName="rotationX"
android:valueFrom="0"
android:valueTo="-360"
android:repeatCount="infinite">
</objectAnimator>
This is my object animator xml
//Animating the NormalLayout
final ObjectAnimator anim4 = (ObjectAnimator) //Object animator
AnimatorInflater.loadAnimator(this, R.animator.rotate_four);
//And this is my java code
I want to add delay between its looping, like 3 secs between looping again. I have tried animation listeners onRepeat
, onEnd
kinda stuff but it didn't worked. I want some delay between looping.
Any help would be appreciated to its utmost limit.
please try
1.delete the xml property android:repeatCount="infinite"
2.add the java code
anim4.addListener(new AnimatorListenerAdapter(){
@Override
public void onAnimationEnd(Animator animation) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
anim4.start();
}
}, 3000);
}
});