Add ArgbEvaluator to ObjectAnimator - Android android.view.animation

Android examples for android.view.animation:ObjectAnimator

Description

Add ArgbEvaluator to ObjectAnimator

Demo Code

import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.util.Property;

public class Main {

  private static final ArgbEvaluator ARGB_EVALUATOR = new ArgbEvaluator();

  public static <T> ObjectAnimator ofArgb(T target, Property<T, Integer> property, int... values) {
    ObjectAnimator animator = ObjectAnimator.ofInt(target, property, values);
    animator.setEvaluator(ARGB_EVALUATOR);
    return animator;
  }/*from  w w  w  .j a  v  a 2  s .co  m*/

}

Related Tutorials