IT. Expert System.

Android Reference

PropertyValuesHolder


android.animation

Class PropertyValuesHolder

  • All Implemented Interfaces:
    Cloneable


    public class PropertyValuesHolder
    extends Object
    implements Cloneable
    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.
    • Field Detail

      • mProperty

        protected Property mProperty
    • Method Detail

      • ofInt

        public static PropertyValuesHolder ofInt(String propertyName,
                                 int... values)
        Constructs and returns a PropertyValuesHolder with a given property name and set of int values.
        Parameters:
        propertyName - The name of the property being animated.
        values - The values that the named property will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofInt

        public static PropertyValuesHolder ofInt(Property<?,Integer> property,
                                 int... values)
        Constructs and returns a PropertyValuesHolder with a given property and set of int values.
        Parameters:
        property - The property being animated. Should not be null.
        values - The values that the property will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofFloat

        public static PropertyValuesHolder ofFloat(String propertyName,
                                   float... values)
        Constructs and returns a PropertyValuesHolder with a given property name and set of float values.
        Parameters:
        propertyName - The name of the property being animated.
        values - The values that the named property will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofFloat

        public static PropertyValuesHolder ofFloat(Property<?,Float> property,
                                   float... values)
        Constructs and returns a PropertyValuesHolder with a given property and set of float values.
        Parameters:
        property - The property being animated. Should not be null.
        values - The values that the property will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofObject

        public static PropertyValuesHolder ofObject(String propertyName,
                                    TypeEvaluator evaluator,
                                    Object... values)
        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.
        Parameters:
        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.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofObject

        public static <V> PropertyValuesHolder ofObject(Property property,
                                        TypeEvaluator<V> evaluator,
                                        V... values)
        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.
        Parameters:
        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.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofKeyframe

        public static PropertyValuesHolder ofKeyframe(String propertyName,
                                      Keyframe... values)
        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.

        Parameters:
        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.
      • ofKeyframe

        public static PropertyValuesHolder ofKeyframe(Property property,
                                      Keyframe... values)
        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 Property.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.

        Parameters:
        property - The property associated with this set of values. Should not be null.
        values - The set of values to animate between.
      • setIntValues

        public void setIntValues(int... values)
        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.
        Parameters:
        values - One or more values that the animation will animate between.
      • setFloatValues

        public void setFloatValues(float... values)
        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.
        Parameters:
        values - One or more values that the animation will animate between.
      • setKeyframes

        public void setKeyframes(Keyframe... values)
        Set the animated values for this object to this set of Keyframes.
        Parameters:
        values - One or more values that the animation will animate between.
      • setObjectValues

        public void setObjectValues(Object... values)
        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.
        Parameters:
        values - One or more values that the animation will animate between.
      • clone

        public PropertyValuesHolder clone()
        Description copied from class: 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.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
      • setEvaluator

        public void setEvaluator(TypeEvaluator evaluator)
        The TypeEvaluator will the 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.
        Parameters:
        evaluator -
      • setPropertyName

        public void setPropertyName(String propertyName)
        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.

        Parameters:
        propertyName - The name of the property being animated.
      • setProperty

        public void setProperty(Property property)
        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.

        Parameters:
        property - The property being animated.
      • getPropertyName

        public String getPropertyName()
        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.
      • toString

        public String toString()
        Description copied from class: Object
        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.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 616 / . Delta: 0.03540 с