Android.Graphics.Drawables.AnimatedVectorDrawable Class
This class uses Android.Animation.ObjectAnimator and Android.Animation.AnimatorSet to animate the properties of a Android.Graphics.Drawables.VectorDrawable to create an animated drawable.

See Also: AnimatedVectorDrawable Members

Syntax

[Android.Runtime.Register("android/graphics/drawable/AnimatedVectorDrawable", DoNotGenerateAcw=true)]
public class AnimatedVectorDrawable : Drawable, IAnimatable, IDisposable

Remarks

This class uses Android.Animation.ObjectAnimator and Android.Animation.AnimatorSet to animate the properties of a Android.Graphics.Drawables.VectorDrawable to create an animated drawable. Here is a simple VectorDrawable in this vectordrawable.xml file. Here is a simple AnimatedVectorDrawable defined in this avd.xml file. Note how we use the names to refer to the groups and paths in the vectordrawable.xml. Here is the rotation.xml, which will rotate the target group for 360 degrees. Here is the path_morph.xml, which will morph the path from one shape to the other. Note that the paths must be compatible for morphing. In more details, the paths should have exact same length of commands , and exact same length of parameters for each commands. Note that the path string are better stored in strings.xml for reusing.

AnimatedVectorDrawable are normally defined as 3 separate XML files.

First is the XML file for Android.Graphics.Drawables.VectorDrawable. Note that we allow the animation happen on the group's attributes and path's attributes, which requires they are uniquely named in this xml file. Groups and paths without animations do not need names.

Second is the AnimatedVectorDrawable's xml file, which defines the target VectorDrawable, the target paths and groups to animate, the properties of the path and group to animate and the animations defined as the ObjectAnimators or AnimatorSets.

Last is the Animator xml file, which is the same as a normal ObjectAnimator or AnimatorSet. To complete this example, here are the 2 animator files used in avd.xml: rotation.xml and path_morph.xml.

[Android Documentation]

Requirements

Namespace: Android.Graphics.Drawables
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0