Ejemplo n.º 1
0
 /**
  * Constructs and returns a ValueAnimator that animates between Object values. A single value
  * implies that that value is the one being animated to. However, this is not typically useful in
  * a ValueAnimator object because there is no way for the object to determine the starting value
  * for the animation (unlike ObjectAnimator, which can derive that value from the target object
  * and property being animated). Therefore, there should typically be two or more values.
  *
  * <p>Since ValueAnimator does not know how to animate between arbitrary Objects, this factory
  * method also takes a TypeEvaluator object that the ValueAnimator will use to perform that
  * interpolation.
  *
  * @param evaluator A TypeEvaluator that will be called on each animation frame to provide the
  *     ncessry interpolation between the Object values to derive the animated value.
  * @param values A set of values that the animation will animate between over time.
  * @return A ValueAnimator object that is set up to animate between the given values.
  */
 public static ValueAnimator ofObject(TypeEvaluator evaluator, Object... values) {
   ValueAnimator anim = new ValueAnimator();
   anim.setObjectValues(values);
   anim.setEvaluator(evaluator);
   return anim;
 }