/** * The type evaluator to be used when calculating the animated values of this animation. * The system will automatically assign a float or int evaluator based on the type * of <code>startValue</code> and <code>endValue</code> in the constructor. But if these values * are not one of these primitive types, or if different evaluation is desired (such as is * necessary with int values that represent colors), a custom evaluator needs to be assigned. * For example, when running an animation on color values, the {@link ArgbEvaluator} * should be used to get correct RGB color interpolation. * * <p>If this ValueAnimator has only one set of values being animated between, this evaluator * will be used for that set. If there are several sets of values being animated, which is * the case if PropertyValuesHOlder objects were set on the ValueAnimator, then the evaluator * is assigned just to the first PropertyValuesHolder object.</p> * * @param value the evaluator to be used this animation */ public void setEvaluator(TypeEvaluator value) { if (value != null && mValues != null && mValues.length > 0) { mValues[0].setEvaluator(value); } }
/** * The type evaluator to be used when calculating the animated values of this animation. * The system will automatically assign a float or int evaluator based on the type * of <code>startValue</code> and <code>endValue</code> in the constructor. But if these values * are not one of these primitive types, or if different evaluation is desired (such as is * necessary with int values that represent colors), a custom evaluator needs to be assigned. * For example, when running an animation on color values, the {@link ArgbEvaluator} * should be used to get correct RGB color interpolation. * * <p>If this ValueAnimator has only one set of values being animated between, this evaluator * will be used for that set. If there are several sets of values being animated, which is * the case if PropertyValuesHOlder objects were set on the ValueAnimator, then the evaluator * is assigned just to the first PropertyValuesHolder object.</p> * * @param value the evaluator to be used this animation */ public void setEvaluator(TypeEvaluator value) { if (value != null && mValues != null && mValues.length > 0) { mValues[0].setEvaluator(value); } }
/** * Constructs and returns a PropertyValuesHolder with a given property name and * set of Object values. This variant also takes a TypeEvaluator because the system * cannot automatically interpolate between objects of unknown type. * * @param propertyName The name of the property being animated. * @param evaluator A TypeEvaluator that will be called on each animation frame to * provide the necessary interpolation between the Object values to derive the animated * value. * @param values The values that the named property will animate between. * @return PropertyValuesHolder The constructed PropertyValuesHolder object. */ public static PropertyValuesHolder ofObject(String propertyName, TypeEvaluator evaluator, Object... values) { PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName); pvh.setObjectValues(values); pvh.setEvaluator(evaluator); return pvh; }
/** * Constructs and returns a PropertyValuesHolder with a given property name and * set of Object values. This variant also takes a TypeEvaluator because the system * cannot automatically interpolate between objects of unknown type. * * @param propertyName The name of the property being animated. * @param evaluator A TypeEvaluator that will be called on each animation frame to * provide the necessary interpolation between the Object values to derive the animated * value. * @param values The values that the named property will animate between. * @return PropertyValuesHolder The constructed PropertyValuesHolder object. */ public static PropertyValuesHolder ofObject(String propertyName, TypeEvaluator evaluator, Object... values) { PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName); pvh.setObjectValues(values); pvh.setEvaluator(evaluator); return pvh; }