/** * Constructs and returns an ObjectAnimator that animates between the sets of values specified * in <code>PropertyValueHolder</code> objects. This variant should be used when animating * several properties at once with the same ObjectAnimator, since PropertyValuesHolder allows * you to associate a set of animation values with a property name. * * @param target The object whose property is to be animated. Depending on how the * PropertyValuesObjects were constructed, the target object should either have the {@link * android.util.Property} objects used to construct the PropertyValuesHolder objects or (if the * PropertyValuesHOlder objects were created with property names) the target object should have * public methods on it called <code>setName()</code>, where <code>name</code> is the name of * the property passed in as the <code>propertyName</code> parameter for each of the * PropertyValuesHolder objects. * @param values A set of PropertyValuesHolder objects whose values will be animated between * over time. * @return An ObjectAnimator object that is set up to animate between the given values. */ public static ObjectAnimator ofPropertyValuesHolder(Object target, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.mTarget = target; anim.setValues(values); return anim; }
/** * Constructs and returns an ObjectAnimator that animates between the sets of values specified * in <code>PropertyValueHolder</code> objects. This variant should be used when animating * several properties at once with the same ObjectAnimator, since PropertyValuesHolder allows * you to associate a set of animation values with a property name. * * @param target The object whose property is to be animated. Depending on how the * PropertyValuesObjects were constructed, the target object should either have the {@link * android.util.Property} objects used to construct the PropertyValuesHolder objects or (if the * PropertyValuesHOlder objects were created with property names) the target object should have * public methods on it called <code>setName()</code>, where <code>name</code> is the name of * the property passed in as the <code>propertyName</code> parameter for each of the * PropertyValuesHolder objects. * @param values A set of PropertyValuesHolder objects whose values will be animated between * over time. * @return An ObjectAnimator object that is set up to animate between the given values. */ public static ObjectAnimator ofPropertyValuesHolder(Object target, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.mTarget = target; anim.setValues(values); return anim; }
@Override public void setIntValues(int... 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.ofInt(mProperty, values)); //} else { setValues(PropertyValuesHolder.ofInt(mPropertyName, values)); //} } else { super.setIntValues(values); } }
@Override public void setIntValues(int... 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.ofInt(mProperty, values)); //} else { setValues(PropertyValuesHolder.ofInt(mPropertyName, values)); //} } else { super.setIntValues(values); } }
@Override public void setFloatValues(float... 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.ofFloat(mProperty, values)); //} else { setValues(PropertyValuesHolder.ofFloat(mPropertyName, values)); //} } else { super.setFloatValues(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); } }
@Override public void setFloatValues(float... 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.ofFloat(mProperty, values)); //} else { setValues(PropertyValuesHolder.ofFloat(mPropertyName, values)); //} } else { super.setFloatValues(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); } }