Dela via


ViewPropertyAnimator Class

Definition

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

[Android.Runtime.Register("android/view/ViewPropertyAnimator", DoNotGenerateAcw=true)]
public class ViewPropertyAnimator : Java.Lang.Object
[<Android.Runtime.Register("android/view/ViewPropertyAnimator", DoNotGenerateAcw=true)>]
type ViewPropertyAnimator = class
    inherit Object
Inheritance
ViewPropertyAnimator
Attributes

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 android.animation.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 android.view.View#animate() will return a reference to the appropriate ViewPropertyAnimator object for that View.

Java documentation for android.view.ViewPropertyAnimator.

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.

Constructors

ViewPropertyAnimator(IntPtr, JniHandleOwnership)

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

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Duration

Returns the current duration of property animations.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Interpolator

Returns the timing interpolator that this animation uses.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
StartDelay

Returns the current startDelay of property animations.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Alpha(Single)

This method will cause the View's alpha property to be animated to the specified value.

AlphaBy(Single)

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.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Rotation(Single)

This method will cause the View's rotation property to be animated to the specified value.

RotationBy(Single)

This method will cause the View's rotation property to be animated by the specified value.

RotationX(Single)

This method will cause the View's rotationX property to be animated to the specified value.

RotationXBy(Single)

This method will cause the View's rotationX property to be animated by the specified value.

RotationY(Single)

This method will cause the View's rotationY property to be animated to the specified value.

RotationYBy(Single)

This method will cause the View's rotationY property to be animated by the specified value.

ScaleX(Single)

This method will cause the View's scaleX property to be animated to the specified value.

ScaleXBy(Single)

This method will cause the View's scaleX property to be animated by the specified value.

ScaleY(Single)

This method will cause the View's scaleY property to be animated to the specified value.

ScaleYBy(Single)

This method will cause the View's scaleY property to be animated by the specified value.

SetDuration(Int64)

Sets the duration for the underlying animator that animates the requested properties.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInterpolator(ITimeInterpolator)

Sets the interpolator for the underlying animator that animates the requested properties.

SetListener(Animator+IAnimatorListener)

Sets a listener for events in the underlying Animators that run the property animations.

SetStartDelay(Int64)

Sets the startDelay for the underlying animator that animates the requested properties.

SetUpdateListener(ValueAnimator+IAnimatorUpdateListener)

Sets a listener for update events in the underlying ValueAnimator that runs the property animations.

Start()

Starts the currently pending property animations immediately.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
TranslationX(Single)

This method will cause the View's translationX property to be animated to the specified value.

TranslationXBy(Single)

This method will cause the View's translationX property to be animated by the specified value.

TranslationY(Single)

This method will cause the View's translationY property to be animated to the specified value.

TranslationYBy(Single)

This method will cause the View's translationY property to be animated by the specified value.

TranslationZ(Single)

This method will cause the View's translationZ property to be animated to the specified value.

TranslationZBy(Single)

This method will cause the View's translationZ property to be animated by the specified value.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WithEndAction(IRunnable)

Specifies an action to take place when the next animation ends.

WithLayer()

The View associated with this ViewPropertyAnimator will have its View#setLayerType(int, android.graphics.Paint) layer type set to View#LAYER_TYPE_HARDWARE for the duration of the next animation.

WithStartAction(IRunnable)

Specifies an action to take place when the next animation runs.

X(Single)

This method will cause the View's x property to be animated to the specified value.

XBy(Single)

This method will cause the View's x property to be animated by the specified value.

Y(Single)

This method will cause the View's y property to be animated to the specified value.

YBy(Single)

This method will cause the View's y property to be animated by the specified value.

Z(Single)

This method will cause the View's z property to be animated to the specified value.

ZBy(Single)

This method will cause the View's z property to be animated by the specified value.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to