java.lang.Object | |
↳ | android.animation.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.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates and returns a copy of this
Object .
| |||||||||||
Gets the name of the property that will be animated.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
set of float values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of float values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of int values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
set of int values.
| |||||||||||
Constructs and returns a PropertyValuesHolder object with the specified property name and set
of values.
| |||||||||||
Constructs and returns a PropertyValuesHolder object with the specified property and set
of values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name to use
as a multi-float setter.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values for use with ObjectAnimator multi-value setters.
| |||||||||||
Constructs and returns a PropertyValuesHolder object with the specified property name or
setter name for use in a multi-float setter function using ObjectAnimator.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
set of
float[] values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name to use
as a multi-int setter.
| |||||||||||
Constructs and returns a PropertyValuesHolder object with the specified property name or
setter name for use in a multi-int setter function using ObjectAnimator.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values for use with ObjectAnimator multi-value setters.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
set of
int[] values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
a Path along which the values should be animated.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
a Path along which the values should be animated.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property name and
set of Object values.
| |||||||||||
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values.
| |||||||||||
Sets the converter to convert from the values type to the setter's parameter type.
| |||||||||||
The TypeEvaluator will be automatically determined based on the type of values
supplied to PropertyValuesHolder.
| |||||||||||
Set the animated values for this object to this set of floats.
| |||||||||||
Set the animated values for this object to this set of ints.
| |||||||||||
Set the animated values for this object to this set of Keyframes.
| |||||||||||
Set the animated values for this object to this set of Objects.
| |||||||||||
Sets the property that will be animated.
| |||||||||||
Sets the name of the property that will be animated.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
Gets the name of the property that will be animated. This name will be used to derive
a setter function that will be called to set animated values.
For example, a property name of 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.
Constructs and returns a PropertyValuesHolder with a given property name and set of float values.
propertyName | The name of the property being animated. |
---|---|
values | The values that the named property will animate between. |
Constructs and returns a PropertyValuesHolder with a given property and set of float values.
property | The property being animated. Should not be null. |
---|---|
values | The values that the property will animate between. |
Constructs and returns a PropertyValuesHolder with a given property and set of int values.
property | The property being animated. Should not be null. |
---|---|
values | The values that the property will animate between. |
Constructs and returns a PropertyValuesHolder with a given property name and set of int values.
propertyName | The name of the property being animated. |
---|---|
values | The values that the named property will animate between. |
Constructs and returns a PropertyValuesHolder object with the specified property name and set
of values. These values can be of any type, but the type should be consistent so that
an appropriate 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. |
Constructs and returns a PropertyValuesHolder object with the specified property and set
of values. These values can be of any type, but the type should be consistent so that
an appropriate 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
get(Object)
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. |
Constructs and returns a PropertyValuesHolder with a given property name to use as a multi-float setter. The values are animated along the path, with the first parameter of the setter set to the x coordinate and the second set to the y coordinate.
propertyName | The name of the property being animated. Can also be the
case-sensitive name of the entire setter method. Should not be null.
The setter must take exactly two float parameters. |
---|---|
path | The Path along which the values should be animated. |
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values for use with ObjectAnimator multi-value setters. The Object
values are converted to float[]
using the converter.
propertyName | The property being animated or complete name of the setter. Should not be null. |
---|---|
converter | Used to convert the animated value to setter parameters. |
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. |
Constructs and returns a PropertyValuesHolder object with the specified property name or
setter name for use in a multi-float setter function using ObjectAnimator. The values can be
of any type, but the type should be consistent so that the supplied
TypeEvaluator
can be used to to evaluate the animated value. The
converter
converts the values to parameters in the setter function.
At least two values must be supplied, a start and an end value.
propertyName | The name of the property to associate with the set of values. This may also be the complete name of a setter function. |
---|---|
converter | Converts values into float parameters for the setter.
Can be null if the Keyframes have float[] values. |
evaluator | Used to interpolate between values. |
values | The values at specific fractional times to evaluate between |
Constructs and returns a PropertyValuesHolder with a given property name and
set of float[]
values. At least two float[]
values must be supplied,
a start and end value. If more values are supplied, the values will be animated from the
start, through all intermediate values to the end value. When used with ObjectAnimator,
the elements of the array represent the parameters of the setter function.
propertyName | The name of the property being animated. Can also be the case-sensitive name of the entire setter method. Should not be null. |
---|---|
values | The values that the property will animate between. |
Constructs and returns a PropertyValuesHolder with a given property name to use as a multi-int setter. The values are animated along the path, with the first parameter of the setter set to the x coordinate and the second set to the y coordinate.
propertyName | The name of the property being animated. Can also be the
case-sensitive name of the entire setter method. Should not be null.
The setter must take exactly two int parameters. |
---|---|
path | The Path along which the values should be animated. |
Constructs and returns a PropertyValuesHolder object with the specified property name or
setter name for use in a multi-int setter function using ObjectAnimator. The values can be
of any type, but the type should be consistent so that the supplied
TypeEvaluator
can be used to to evaluate the animated value. The
converter
converts the values to parameters in the setter function.
At least two values must be supplied, a start and an end value.
propertyName | The name of the property to associate with the set of values. This may also be the complete name of a setter function. |
---|---|
converter | Converts values into int parameters for the setter.
Can be null if the Keyframes have int[] values. |
evaluator | Used to interpolate between values. |
values | The values at specific fractional times to evaluate between |
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values for use with ObjectAnimator multi-value setters. The Object
values are converted to int[]
using the converter.
propertyName | The property being animated or complete name of the setter. Should not be null. |
---|---|
converter | Used to convert the animated value to setter parameters. |
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. |
Constructs and returns a PropertyValuesHolder with a given property name and
set of int[]
values. At least two int[]
values must be supplied,
a start and end value. If more values are supplied, the values will be animated from the
start, through all intermediate values to the end value. When used with ObjectAnimator,
the elements of the array represent the parameters of the setter function.
propertyName | The name of the property being animated. Can also be the case-sensitive name of the entire setter method. Should not be null. |
---|---|
values | The values that the property will animate between. |
Constructs and returns a PropertyValuesHolder with a given property and
a Path along which the values should be animated. This variant supports a
TypeConverter
to convert from PointF
to the target
type.
The PointF passed to converter
or property
, if
converter
is null
, is reused on each animation frame and should
not be stored by the setter or TypeConverter.
property | The property being animated. Should not be null. |
---|---|
converter | Converts a PointF to the type associated with the setter. May be null if conversion is unnecessary. |
path | The Path along which the values should be animated. |
Constructs and returns a PropertyValuesHolder with a given property name and
a Path along which the values should be animated. This variant supports a
TypeConverter
to convert from PointF
to the target
type.
The PointF passed to converter
or property
, if
converter
is null
, is reused on each animation frame and should
not be stored by the setter or TypeConverter.
propertyName | The name of the property being animated. |
---|---|
converter | Converts a PointF to the type associated with the setter. May be null if conversion is unnecessary. |
path | The Path along which the values should be animated. |
Constructs and returns a PropertyValuesHolder with a given property and set of Object values. This variant also takes a TypeEvaluator because the system cannot automatically interpolate between objects of unknown type.
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. |
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.
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. |
Constructs and returns a PropertyValuesHolder with a given property and
set of Object values. This variant also takes a TypeEvaluator because the system
cannot automatically interpolate between objects of unknown type. This variant also
takes a TypeConverter
to convert from animated values to the type
of the property. If only one value is supplied, the TypeConverter
must be a BidirectionalTypeConverter
to retrieve the current
value.
property | The property being animated. Should not be null. |
---|---|
converter | Converts the animated object to the Property type. |
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. |
Sets the converter to convert from the values type to the setter's parameter type.
If only one value is supplied, converter must be a
BidirectionalTypeConverter
.
converter | The converter to use to convert values. |
---|
The TypeEvaluator will be automatically determined based on the type of values supplied to PropertyValuesHolder. The evaluator can be manually set, however, if so desired. This may be important in cases where either the type of the values supplied do not match the way that they should be interpolated between, or if the values are of a custom type or one not currently understood by the animation system. Currently, only values of type float and int (and their Object equivalents: Float and Integer) are correctly interpolated; all other types require setting a TypeEvaluator.
Set the animated values for this object to this set of floats.
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.
values | One or more values that the animation will animate between. |
---|
Set the animated values for this object to this set of ints.
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.
values | One or more values that the animation will animate between. |
---|
Set the animated values for this object to this set of Keyframes.
values | One or more values that the animation will animate between. |
---|
Set the animated values for this object to this set of Objects.
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.
values | One or more values that the animation will animate between. |
---|
Sets the property that will be animated.
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. |
---|
Sets the name of the property that will be animated. This name is used to derive
a setter function that will be called to set animated values.
For example, a property name of 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. |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.