Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

PropertyValuesHolder

open class PropertyValuesHolder : Cloneable
kotlin.Any
   ↳ androidx.core.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.

Summary

Public methods
open PropertyValuesHolder

open String

Gets the name of the property that will be animated.

open static PropertyValuesHolder
ofFloat(@NonNull propertyName: String, @NonNull vararg values: Float)

Constructs and returns a PropertyValuesHolder with a given property name and set of float values.

open static PropertyValuesHolder
ofFloat(@NonNull property: Property<*, Float!>, @NonNull vararg values: Float)

Constructs and returns a PropertyValuesHolder with a given property and set of float values.

open static PropertyValuesHolder
ofInt(@NonNull propertyName: String, @NonNull vararg values: Int)

Constructs and returns a PropertyValuesHolder with a given property name and set of int values.

open static PropertyValuesHolder
ofInt(@NonNull property: Property<*, Int!>, @NonNull vararg values: Int)

Constructs and returns a PropertyValuesHolder with a given property and set of int values.

open static PropertyValuesHolder
ofKeyframe(@NonNull propertyName: String, @NonNull vararg values: Keyframe<Any!>!)

Constructs and returns a PropertyValuesHolder object with the specified property name and set of values.

open static PropertyValuesHolder
ofKeyframe(@NonNull property: Property<Any!, Any!>, @NonNull vararg values: Keyframe<Any!>!)

Constructs and returns a PropertyValuesHolder object with the specified property and set of values.

open static PropertyValuesHolder
ofMultiFloat(@NonNull propertyName: String, @NonNull values: Array<FloatArray!>)

Constructs and returns a PropertyValuesHolder with a given property name and set of float[] values.

open static PropertyValuesHolder
ofMultiFloat(@NonNull propertyName: String, @NonNull path: Path)

Constructs and returns a PropertyValuesHolder with a given property name to use as a multi-float setter.

open static PropertyValuesHolder
ofMultiFloat(@NonNull propertyName: String, @NonNull converter: TypeConverter<V, FloatArray!>, @NonNull evaluator: TypeEvaluator<V>, @NonNull vararg values: V)

Constructs and returns a PropertyValuesHolder with a given property and set of Object values for use with ObjectAnimator multi-value setters.

open static PropertyValuesHolder
ofMultiFloat(@NonNull propertyName: String, @Nullable converter: TypeConverter<T, FloatArray!>?, @NonNull evaluator: TypeEvaluator<T>, @NonNull vararg values: Keyframe<Any!>!)

Constructs and returns a PropertyValuesHolder object with the specified property name or setter name for use in a multi-float setter function using ObjectAnimator.

open static PropertyValuesHolder
ofMultiInt(@NonNull propertyName: String, @NonNull values: Array<IntArray!>)

Constructs and returns a PropertyValuesHolder with a given property name and set of int[] values.

open static PropertyValuesHolder
ofMultiInt(@NonNull propertyName: String, @NonNull path: Path)

Constructs and returns a PropertyValuesHolder with a given property name to use as a multi-int setter.

open static PropertyValuesHolder
ofMultiInt(@NonNull propertyName: String, @NonNull converter: TypeConverter<V, IntArray!>, @NonNull evaluator: TypeEvaluator<V>, @NonNull vararg values: V)

Constructs and returns a PropertyValuesHolder with a given property and set of Object values for use with ObjectAnimator multi-value setters.

open static PropertyValuesHolder
ofMultiInt(@NonNull propertyName: String, @Nullable converter: TypeConverter<T, IntArray!>?, @NonNull evaluator: TypeEvaluator<T>, @NonNull vararg values: Keyframe<Any!>!)

Constructs and returns a PropertyValuesHolder object with the specified property name or setter name for use in a multi-int setter function using ObjectAnimator.

open static PropertyValuesHolder
ofObject(@NonNull propertyName: String, @NonNull evaluator: TypeEvaluator<Any!>, @NonNull vararg values: Any!)

Constructs and returns a PropertyValuesHolder with a given property name and set of Object values.

open static PropertyValuesHolder
ofObject(@NonNull propertyName: String, @Nullable converter: TypeConverter<PointF!, *>?, @NonNull path: Path)

Constructs and returns a PropertyValuesHolder with a given property name and a Path along which the values should be animated.

open static PropertyValuesHolder
ofObject(@NonNull property: Property<Any!, Any!>, @NonNull evaluator: TypeEvaluator<V>, @NonNull vararg values: V)

Constructs and returns a PropertyValuesHolder with a given property and set of Object values.

open static PropertyValuesHolder
ofObject(@NonNull property: Property<*, V>, @NonNull converter: TypeConverter<T, V>, @NonNull evaluator: TypeEvaluator<T>, @NonNull vararg values: T)

Constructs and returns a PropertyValuesHolder with a given property and set of Object values.

open static PropertyValuesHolder
ofObject(@NonNull property: Property<*, V>, @Nullable converter: TypeConverter<PointF!, V>?, @NonNull path: Path)

Constructs and returns a PropertyValuesHolder with a given property and a Path along which the values should be animated.

open Unit
setConverter(@Nullable converter: TypeConverter<Any!, Any!>?)

Sets the converter to convert from the values type to the setter's parameter type.

open Unit
setEvaluator(@NonNull evaluator: TypeEvaluator<Any!>)

The TypeEvaluator will be automatically determined based on the type of values supplied to PropertyValuesHolder.

open Unit
setFloatValues(@NonNull vararg values: Float)

Set the animated values for this object to this set of floats.

open Unit
setIntValues(@NonNull vararg values: Int)

Set the animated values for this object to this set of ints.

open Unit
setKeyframes(@NonNull vararg values: Keyframe<Any!>!)

Set the animated values for this object to this set of Keyframes.

open Unit
setObjectValues(@NonNull vararg values: Any!)

Set the animated values for this object to this set of Objects.

open Unit
setProperty(@NonNull property: Property<Any!, Any!>)

Sets the property that will be animated.

open Unit
setPropertyName(@NonNull propertyName: String)

Sets the name of the property that will be animated.

open String

Public methods

clone

@NonNull open fun clone(): PropertyValuesHolder

getPropertyName

@NonNull open fun getPropertyName(): String

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.

ofFloat

@NonNull open static fun ofFloat(
    @NonNull propertyName: String,
    @NonNull vararg values: Float
): PropertyValuesHolder

Constructs and returns a PropertyValuesHolder with a given property name and set of float values.

Parameters
propertyName String: The name of the property being animated.
values Float: The values that the named property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofFloat

@NonNull open static fun ofFloat(
    @NonNull property: Property<*, Float!>,
    @NonNull vararg values: Float
): PropertyValuesHolder

Constructs and returns a PropertyValuesHolder with a given property and set of float values.

Parameters
property Property<*, Float!>: The property being animated. Should not be null.
values Float: The values that the property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofInt

@NonNull open static fun ofInt(
    @NonNull propertyName: String,
    @NonNull vararg values: Int
): PropertyValuesHolder

Constructs and returns a PropertyValuesHolder with a given property name and set of int values.

Parameters
propertyName String: The name of the property being animated.
values Int: The values that the named property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofInt

@NonNull open static fun ofInt(
    @NonNull property: Property<*, Int!>,
    @NonNull vararg values: Int
): PropertyValuesHolder

Constructs and returns a PropertyValuesHolder with a given property and set of int values.

Parameters
property Property<*, Int!>: The property being animated. Should not be null.
values Int: The values that the property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofKeyframe

@SafeVarargs @NonNull open static fun ofKeyframe(
    @NonNull propertyName: String,
    @NonNull vararg values: Keyframe<Any!>!
): PropertyValuesHolder

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 String: 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 Keyframe<Any!>!: The set of values to animate between.

ofKeyframe

@SafeVarargs @NonNull open static fun ofKeyframe(
    @NonNull property: Property<Any!, Any!>,
    @NonNull vararg values: Keyframe<Any!>!
): PropertyValuesHolder

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 androidx.core.animation.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 android.util.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 Property<Any!, Any!>: The property associated with this set of values. Should not be null.
values Keyframe<Any!>!: The set of values to animate between.

ofMultiFloat

@NonNull open static fun ofMultiFloat(
    @NonNull propertyName: String,
    @NonNull values: Array<FloatArray!>
): PropertyValuesHolder

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.

Parameters
propertyName String: The name of the property being animated. Can also be the case-sensitive name of the entire setter method. Should not be null.
values Array<FloatArray!>: The values that the property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofMultiFloat

@NonNull open static fun ofMultiFloat(
    @NonNull propertyName: String,
    @NonNull path: Path
): PropertyValuesHolder

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.

Parameters
propertyName String: 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 Path: The Path along which the values should be animated.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofMultiFloat

@SafeVarargs @NonNull open static fun <V : Any!> ofMultiFloat(
    @NonNull propertyName: String,
    @NonNull converter: TypeConverter<V, FloatArray!>,
    @NonNull evaluator: TypeEvaluator<V>,
    @NonNull vararg values: V
): PropertyValuesHolder

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.

Parameters
propertyName String: The property being animated or complete name of the setter. Should not be null.
converter TypeConverter<V, FloatArray!>: Used to convert the animated value to setter parameters.
evaluator TypeEvaluator<V>: 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 V: The values that the property will animate between.
Return
PropertyValuesHolder PropertyValuesHolder The constructed PropertyValuesHolder object.

ofMultiFloat

@SafeVarargs @NonNull open static fun <T : Any!> ofMultiFloat(
    @NonNull propertyName: