|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nineoldandroids.animation.PropertyValuesHolder
public class PropertyValuesHolder
This class holds information about a property and the values that that property should take on during an animation. PropertyValuesHolder objects can be used to create animations with ValueAnimator or ObjectAnimator that operate on several different properties in parallel.
Method Summary | ||
---|---|---|
PropertyValuesHolder |
clone()
|
|
String |
getPropertyName()
Gets the name of the property that will be animated. |
|
static PropertyValuesHolder |
ofFloat(Property<?,Float> property,
float... values)
Constructs and returns a PropertyValuesHolder with a given property and set of float values. |
|
static PropertyValuesHolder |
ofFloat(String propertyName,
float... values)
Constructs and returns a PropertyValuesHolder with a given property name and set of float values. |
|
static PropertyValuesHolder |
ofInt(Property<?,Integer> property,
int... values)
Constructs and returns a PropertyValuesHolder with a given property and set of int values. |
|
static PropertyValuesHolder |
ofInt(String propertyName,
int... values)
Constructs and returns a PropertyValuesHolder with a given property name and set of int values. |
|
static PropertyValuesHolder |
ofKeyframe(Property property,
Keyframe... values)
Constructs and returns a PropertyValuesHolder object with the specified property and set of values. |
|
static PropertyValuesHolder |
ofKeyframe(String propertyName,
Keyframe... values)
Constructs and returns a PropertyValuesHolder object with the specified property name and set of values. |
|
static
|
ofObject(Property property,
TypeEvaluator<V> evaluator,
V... values)
Constructs and returns a PropertyValuesHolder with a given property and set of Object values. |
|
static PropertyValuesHolder |
ofObject(String propertyName,
TypeEvaluator evaluator,
Object... values)
Constructs and returns a PropertyValuesHolder with a given property name and set of Object values. |
|
void |
setEvaluator(TypeEvaluator evaluator)
The TypeEvaluator will the automatically determined based on the type of values supplied to PropertyValuesHolder. |
|
void |
setFloatValues(float... values)
Set the animated values for this object to this set of floats. |
|
void |
setIntValues(int... values)
Set the animated values for this object to this set of ints. |
|
void |
setKeyframes(Keyframe... values)
Set the animated values for this object to this set of Keyframes. |
|
void |
setObjectValues(Object... values)
Set the animated values for this object to this set of Objects. |
|
void |
setProperty(Property property)
Sets the property that will be animated. |
|
void |
setPropertyName(String propertyName)
Sets the name of the property that will be animated. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static PropertyValuesHolder ofInt(String propertyName, int... values)
propertyName
- The name of the property being animated.values
- The values that the named property will animate between.
public static PropertyValuesHolder ofInt(Property<?,Integer> property, int... values)
property
- The property being animated. Should not be null.values
- The values that the property will animate between.
public static PropertyValuesHolder ofFloat(String propertyName, float... values)
propertyName
- The name of the property being animated.values
- The values that the named property will animate between.
public static PropertyValuesHolder ofFloat(Property<?,Float> property, float... values)
property
- The property being animated. Should not be null.values
- The values that the property will animate between.
public static PropertyValuesHolder ofObject(String propertyName, TypeEvaluator evaluator, Object... values)
propertyName
- The name of the property being animated.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.values
- The values that the named property will animate between.
public static <V> PropertyValuesHolder ofObject(Property property, TypeEvaluator<V> evaluator, V... values)
property
- The property being animated. Should not be null.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.values
- The values that the property will animate between.
public static PropertyValuesHolder ofKeyframe(String propertyName, Keyframe... values)
TypeEvaluator
can be found that matches
the common type.
If there is only one value, it is assumed to be the end value of an animation,
and an initial value will be derived, if possible, by calling a getter function
on the object. Also, if any value is null, the value will be filled in when the animation
starts in the same way. This mechanism of automatically getting null values only works
if the PropertyValuesHolder object is used in conjunction
ObjectAnimator
, and with a getter function
derived automatically from propertyName
, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
propertyName
- The name of the property associated with this set of values. This
can be the actual property name to be used when using a ObjectAnimator object, or
just a name used to get animated values, such as if this object is used with an
ValueAnimator object.values
- The set of values to animate between.public static PropertyValuesHolder ofKeyframe(Property property, Keyframe... values)
TypeEvaluator
can be found that matches
the common type.
If there is only one value, it is assumed to be the end value of an animation,
and an initial value will be derived, if possible, by calling the property's
Property
function.
Also, if any value is null, the value will be filled in when the animation
starts in the same way. This mechanism of automatically getting null values only works
if the PropertyValuesHolder object is used in conjunction with
ObjectAnimator
, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
property
- The property associated with this set of values. Should not be null.values
- The set of values to animate between.public void setIntValues(int... values)
ObjectAnimator
, and with a getter function
derived automatically from propertyName
, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
values
- One or more values that the animation will animate between.public void setFloatValues(float... values)
ObjectAnimator
, and with a getter function
derived automatically from propertyName
, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
values
- One or more values that the animation will animate between.public void setKeyframes(Keyframe... values)
values
- One or more values that the animation will animate between.public void setObjectValues(Object... values)
ObjectAnimator
, and with a getter function
derived automatically from propertyName
, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
values
- One or more values that the animation will animate between.public PropertyValuesHolder clone()
clone
in class Object
public void setEvaluator(TypeEvaluator evaluator)
evaluator
- public void setPropertyName(String propertyName)
foo
will result
in a call to the function setFoo()
on the target object. If either
valueFrom
or valueTo
is null, then a getter function will
also be derived and called.
Note that the setter function derived from this property name
must take the same parameter type as the
valueFrom
and valueTo
properties, otherwise the call to
the setter function will fail.
propertyName
- The name of the property being animated.public void setProperty(Property property)
Note that if this PropertyValuesHolder object is used with ObjectAnimator, the property must exist on the target object specified in that ObjectAnimator.
property
- The property being animated.public String getPropertyName()
foo
will result
in a call to the function setFoo()
on the target object. If either
valueFrom
or valueTo
is null, then a getter function will
also be derived and called.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |