@Override public void setObjectValues(Object... values) { if (mValues == null || mValues.length == 0) { // No values yet - this animator is being constructed piecemeal. Init the values with // whatever the current propertyName is //if (mProperty != null) { // setValues(PropertyValuesHolder.ofObject(mProperty, (TypeEvaluator)null, values)); //} else { setValues(PropertyValuesHolder.ofObject(mPropertyName, (TypeEvaluator)null, values)); //} } else { super.setObjectValues(values); } }
@Override public void setObjectValues(Object... values) { if (mValues == null || mValues.length == 0) { // No values yet - this animator is being constructed piecemeal. Init the values with // whatever the current propertyName is //if (mProperty != null) { // setValues(PropertyValuesHolder.ofObject(mProperty, (TypeEvaluator)null, values)); //} else { setValues(PropertyValuesHolder.ofObject(mPropertyName, (TypeEvaluator)null, values)); //} } else { super.setObjectValues(values); } }
/** * 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; }
/** * 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; }