You can always create a AnimatedVectorDrawableCompat object and use it as a Drawable by the Java
API. In order to refer to AnimatedVectorDrawableCompat inside a XML file, you can use
app:srcCompat attribute in AppCompat library's ImageButton or ImageView.

Note that the animation in AnimatedVectorDrawableCompat now can support the following features:

Path Morphing (PathType evaluator). This is used for morphing one path into another.

Path Interpolation. This is used to defined a flexible interpolator (represented as a path)
instead of the system defined ones like LinearInterpolator.

Animating 2 values in one ObjectAnimator according to one path's X value and Y value. One
usage is moving one object in both X and Y dimensions along an path.

clearAnimationCallbacks

clearAnimationCallbacks

Utility function to clear animation callbacks from Drawable, when the drawable is
created from XML and referred in Java code, e.g: ImageView.getDrawable().
From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
Otherwise, it is treated as AnimatedVectorDrawableCompat.

createFromXmlInner

Create a AnimatedVectorDrawableCompat from inside an XML document using an optional
Resources.Theme. Called on a parser positioned at a tag in an XML
document, tries to create a Drawable from that tag. Returns null
if the tag is not a valid drawable.

registerAnimationCallback

Utility function to register callback to Drawable, when the drawable is created from XML and
referred in Java code, e.g: ImageView.getDrawable().
From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
Otherwise, it is treated as AnimatedVectorDrawableCompat.

unregisterAnimationCallback

Utility function to unregister animation callback from Drawable, when the drawable is
created from XML and referred in Java code, e.g: ImageView.getDrawable().
From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
Otherwise, it is treated as AnimatedVectorDrawableCompat.