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.
Utility function to clear animation callbacks from Drawable, when the drawable is
created from XML and referred in Java code, e.g: ImageView.getDrawable().
Utility function to unregister animation callback from Drawable, when the drawable is
created from XML and referred in Java code, e.g: ImageView.getDrawable().
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.
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.
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.
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-11 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-11 UTC."]]