set Repeatable Animation - Android android.view.animation

Android examples for android.view.animation:Animation

Description

set Repeatable Animation

Demo Code

import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.app.Activity;
import android.view.View;

public class Main {

   static Animator setRepeatableAnim(Activity activity, View target, final int duration, int animRes) {
    final Animator anim = AnimatorInflater.loadAnimator(activity, animRes);
    anim.setDuration(duration);/*from  w w  w .  j  a v  a2  s.com*/
    anim.setTarget(target);
    return anim;
  }

}

Related Tutorials