ViewPropertyAnimator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- 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
| Name | Description |
|---|---|
| ViewPropertyAnimator(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| 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 |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState | (Inherited from JavaObject) |
| JniPeerMembers |
Gets the JNI peer metadata used by the .NET for Android binding runtime. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| StartDelay |
Returns the current startDelay of property animations. |
| ThresholdClass |
Gets the JNI class handle used by the .NET for Android binding runtime. |
| ThresholdType |
Gets the managed type used by the .NET for Android binding runtime. |
Methods
| Name | Description |
|---|---|
| Alpha(Single) |
This method will cause the View's |
| AlphaBy(Single) |
This method will cause the View's |
| Cancel() |
Cancels all property animations that are currently running or pending. |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() | (Inherited from JavaObject) |
| Equals(Object) | (Inherited from JavaObject) |
| 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 |
| RotationBy(Single) |
This method will cause the View's |
| RotationX(Single) |
This method will cause the View's |
| RotationXBy(Single) |
This method will cause the View's |
| RotationY(Single) |
This method will cause the View's |
| RotationYBy(Single) |
This method will cause the View's |
| ScaleX(Single) |
This method will cause the View's |
| ScaleXBy(Single) |
This method will cause the View's |
| ScaleY(Single) |
This method will cause the View's |
| ScaleYBy(Single) |
This method will cause the View's |
| SetDuration(Int64) |
Sets the duration for the underlying animator that animates the requested properties. By default, the animator uses the default value for ValueAnimator. Calling this method will cause the declared value to be used instead. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetInterpolator(ITimeInterpolator) |
Sets the interpolator for the underlying animator that animates the requested properties. By default, the animator uses the default interpolator for ValueAnimator. Calling this method will cause the declared object to be used instead. |
| SetListener(Animator+IAnimatorListener) |
Sets a listener for events in the underlying Animators that run the property animations. |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| SetStartDelay(Int64) |
Sets the startDelay for the underlying animator that animates the requested properties. By default, the animator uses the default value for ValueAnimator. Calling this method will cause the declared value to be used instead. |
| 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. Calling start() is optional because all animations start automatically at the next opportunity. However, if the animations are needed to start immediately and synchronously (not at the time when the next event is processed by the hierarchy, which is when the animations would begin otherwise), then this method can be used. |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| TranslationX(Single) |
This method will cause the View's |
| TranslationXBy(Single) |
This method will cause the View's |
| TranslationY(Single) |
This method will cause the View's |
| TranslationYBy(Single) |
This method will cause the View's |
| TranslationZ(Single) |
This method will cause the View's |
| TranslationZBy(Single) |
This method will cause the View's |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (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
|
| WithStartAction(IRunnable) |
Specifies an action to take place when the next animation runs. |
| X(Single) |
This method will cause the View's |
| XBy(Single) |
This method will cause the View's |
| Y(Single) |
This method will cause the View's |
| YBy(Single) |
This method will cause the View's |
| Z(Single) |
This method will cause the View's |
| ZBy(Single) |
This method will cause the View's |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IJavaPeerable.Disposed() | (Inherited from JavaObject) |
| IJavaPeerable.Finalized() | (Inherited from JavaObject) |
| IJavaPeerable.JniObjectReferenceControlBlock | (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from JavaObject) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |