Android Guides | Samples

Android.Views.ViewPropertyAnimator Class

This class enables automatic and optimized animation of select properties on View objects.

See Also: ViewPropertyAnimator

Syntax

[Android.Runtime.Register("android/view/ViewPropertyAnimator", DoNotGenerateAcw=true)]
public class ViewPropertyAnimator : Object

Remarks

This class enables automatic and optimized animation of select properties on View objects. If only one or two properties on a View object are being animated, then using an ObjectAnimator is fine; the property setters called by ObjectAnimator are well equipped to do the right thing to set the property and invalidate the view appropriately. But if several properties are animated simultaneously, or if you just want a more convenient syntax to animate a specific property, then ViewPropertyAnimator might be more well-suited to the task.

This class may provide better performance for several simultaneous animations, because it will optimize invalidate calls to take place only once for several properties instead of each animated property independently causing its own invalidation. Also, the syntax of using this class could be easier to use because the caller need only tell the View object which property to animate, and the value to animate either to or by, and this class handles the details of configuring the underlying Animator class and starting it.

This class is not constructed by the caller, but rather by the View whose properties it will animate. Calls to View.Animate will return a reference to the appropriate ViewPropertyAnimator object for that View.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 12

The members of Android.Views.ViewPropertyAnimator are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
DurationInt64. Returns the current duration of property animations.
[read-only]
InterpolatorITimeInterpolator. Returns the timing interpolator that this animation uses.
[read-only]
StartDelayInt64. Returns the current startDelay of property animations.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Alpha(Single) : ViewPropertyAnimator
This method will cause the View's alpha property to be animated to the specified value.
AlphaBy(Single) : ViewPropertyAnimator
This method will cause the View's alpha property to be animated by the specified value.
Cancel()
Cancels all property animations that are currently running or pending.
Rotation(Single) : ViewPropertyAnimator
This method will cause the View's rotation property to be animated to the specified value.
RotationBy(Single) : ViewPropertyAnimator
This method will cause the View's rotation property to be animated by the specified value.
RotationX(Single) : ViewPropertyAnimator
This method will cause the View's rotationX property to be animated to the specified value.
RotationXBy(Single) : ViewPropertyAnimator
This method will cause the View's rotationX property to be animated by the specified value.
RotationY(Single) : ViewPropertyAnimator
This method will cause the View's rotationY property to be animated to the specified value.
RotationYBy(Single) : ViewPropertyAnimator
This method will cause the View's rotationY property to be animated by the specified value.
ScaleX(Single) : ViewPropertyAnimator
This method will cause the View's scaleX property to be animated to the specified value.
ScaleXBy(Single) : ViewPropertyAnimator
This method will cause the View's scaleX property to be animated by the specified value.
ScaleY(Single) : ViewPropertyAnimator
This method will cause the View's scaleY property to be animated to the specified value.
ScaleYBy(Single) : ViewPropertyAnimator
This method will cause the View's scaleY property to be animated by the specified value.
SetDuration(Int64) : ViewPropertyAnimator
Sets the duration for the underlying animator that animates the requested properties.
SetInterpolator(ITimeInterpolator) : ViewPropertyAnimator
Sets the interpolator for the underlying animator that animates the requested properties.
SetListener(Animator+IAnimatorListener) : ViewPropertyAnimator
Sets a listener for events in the underlying Animators that run the property animations.
SetStartDelay(Int64) : ViewPropertyAnimator
Sets the startDelay for the underlying animator that animates the requested properties.
SetUpdateListener(ValueAnimator+IAnimatorUpdateListener) : ViewPropertyAnimator
Sets a listener for update events in the underlying ValueAnimator that runs the property animations.
Start()
Starts the currently pending property animations immediately.
TranslationX(Single) : ViewPropertyAnimator
This method will cause the View's translationX property to be animated to the specified value.
TranslationXBy(Single) : ViewPropertyAnimator
This method will cause the View's translationX property to be animated by the specified value.
TranslationY(Single) : ViewPropertyAnimator
This method will cause the View's translationY property to be animated to the specified value.
TranslationYBy(Single) : ViewPropertyAnimator
This method will cause the View's translationY property to be animated by the specified value.
TranslationZ(Single) : ViewPropertyAnimator
This method will cause the View's translationZ property to be animated to the specified value.
TranslationZBy(Single) : ViewPropertyAnimator
This method will cause the View's translationZ property to be animated by the specified value.
WithEndAction(IRunnable) : ViewPropertyAnimator
Specifies an action to take place when the next animation ends.
WithLayer() : ViewPropertyAnimator
The View associated with this ViewPropertyAnimator will have its View.SetLayerType(LayerType,Paint) set to View.LAYER_TYPE_HARDWARE for the duration of the next animation.
WithStartAction(IRunnable) : ViewPropertyAnimator
Specifies an action to take place when the next animation runs.
X(Single) : ViewPropertyAnimator
This method will cause the View's x property to be animated to the specified value.
XBy(Single) : ViewPropertyAnimator
This method will cause the View's x property to be animated by the specified value.
Y(Single) : ViewPropertyAnimator
This method will cause the View's y property to be animated to the specified value.
YBy(Single) : ViewPropertyAnimator
This method will cause the View's y property to be animated by the specified value.
Z(Single) : ViewPropertyAnimator
This method will cause the View's z property to be animated to the specified value.
ZBy(Single) : ViewPropertyAnimator
This method will cause the View's z property to be animated by the specified value.