AnimatedVectorDrawableCompat
open class AnimatedVectorDrawableCompat : VectorDrawableCommon, Animatable2Compat
androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat |
For API 24 and above, this class is delegating to the framework's . For older API version, this class uses android.animation.ObjectAnimator
and android.animation.AnimatorSet
to animate the properties of a to create an animated drawable.
AnimatedVectorDrawable
.
Here are all the animatable attributes in VectorDrawableCompat
:
Element Name | Animatable attribute name |
---|---|
<vector> | alpha |
<group> | rotation |
pivotX | |
pivotY | |
scaleX | |
scaleY | |
translateX | |
translateY | |
<path> | fillColor |
pathData | |
strokeColor | |
strokeWidth | |
strokeAlpha | |
fillAlpha | |
trimPathStart | |
trimPathEnd | |
trimPathOffset |
- 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.
Summary
Public methods | |
---|---|
open Unit |
applyTheme(t: Theme) |
open Boolean | |
open Unit | |
open static Unit |
Utility function to clear animation callbacks from Drawable, when the drawable is created from XML and referred in Java code, e. |
open static AnimatedVectorDrawableCompat? |
Create a AnimatedVectorDrawableCompat object. |
open static AnimatedVectorDrawableCompat! |
createFromXmlInner(context: Context!, r: Resources!, parser: XmlPullParser!, attrs: AttributeSet!, theme: Theme!) Create a AnimatedVectorDrawableCompat from inside an XML document using an optional |
open Unit | |
open Int |
getAlpha() |
open Int | |
open ColorFilter? | |
open ConstantState? |
Note that we don't support constant state when SDK < 24. |
open Int | |
open Int | |
open Int | |
open Unit |
inflate(res: Resources, parser: XmlPullParser, attrs: AttributeSet, theme: Theme?) |
open Unit |
inflate(res: Resources, parser: XmlPullParser, attrs: AttributeSet) |
open Boolean | |
open Boolean | |
open Boolean | |
open Drawable |
mutate() mutate() will be effective only if the getConstantState() is returning non-null. |
open Unit |
registerAnimationCallback(@NonNull callback: Animatable2Compat.AnimationCallback) |
open static Unit |
registerAnimationCallback(dr: Drawable!, callback: |