ObjectAnimator.PropertyName Property

Definition

Gets the name of the property that will be animated. -or- Sets the name of the property that will be animated.

public string? PropertyName { [Android.Runtime.Register("getPropertyName", "()Ljava/lang/String;", "")] get; [Android.Runtime.Register("setPropertyName", "(Ljava/lang/String;)V", "")] set; }
[<get: Android.Runtime.Register("getPropertyName", "()Ljava/lang/String;", "")>]
[<set: Android.Runtime.Register("setPropertyName", "(Ljava/lang/String;)V", "")>]
member this.PropertyName : string with get, set

Property Value

Attributes

Remarks

Property getter documentation:

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.

If this animator was created with a Property object instead of the string name of a property, then this method will return the Property#getName() name of that Property object instead. If this animator was created with one or more PropertyValuesHolder objects, then this method will return the PropertyValuesHolder#getPropertyName() name of that object (if there was just one) or a comma-separated list of all of the names (if there are more than one).

Java documentation for android.animation.ObjectAnimator.getPropertyName().

Property setter documentation:

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.

For best performance of the mechanism that calls the setter function determined by the name of the property being animated, use float or int typed values, and make the setter function for those properties have a void return value. This will cause the code to take an optimized path for these constrained circumstances. Other property types and return types will work, but will have more overhead in processing the requests due to normal reflection mechanisms.

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.

If this ObjectAnimator has been set up to animate several properties together, using more than one PropertyValuesHolder objects, then setting the propertyName simply sets the propertyName in the first of those PropertyValuesHolder objects.

Java documentation for android.animation.ObjectAnimator.setPropertyName(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to