public class LottieDrawable
extends android.graphics.drawable.Drawable
implements android.graphics.drawable.Drawable.Callback
recycleBitmaps() when you are done
or else you will leak bitmaps.
It is preferable to use LottieAnimationView when possible because it
handles bitmap recycling and asynchronous loading
of compositions.
| Constructor and Description |
|---|
LottieDrawable() |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(android.graphics.Canvas canvas) |
int |
getAlpha() |
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
int |
getOpacity() |
boolean |
hasMasks()
Returns whether or not any layers in this composition has masks.
|
boolean |
hasMatte()
Returns whether or not any layers in this composition has a matte layer.
|
void |
invalidateDrawable(android.graphics.drawable.Drawable who)
These Drawable.Callback methods proxy the calls so that this is the drawable that is
actually invalidated, not a child one which will not pass the view's validateDrawable check.
|
void |
invalidateSelf() |
void |
recycleBitmaps()
If you have image assets and use
LottieDrawable directly, you must call this yourself. |
void |
scheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what,
long when) |
void |
setAlpha(int alpha) |
void |
setColorFilter(android.graphics.ColorFilter colorFilter) |
void |
setImagesAssetsFolder(java.lang.String imageAssetsFolder)
If you use image assets, you must explicitly specify the folder in assets/ in which they are
located because bodymovin uses the name filenames across all compositions (img_#).
|
void |
setProgress(float progress) |
void |
unscheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what) |
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, isAutoMirrored, isFilterBitmap, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintList, setTintMode, setVisible, unscheduleSelfpublic boolean hasMasks()
public boolean hasMatte()
public void setImagesAssetsFolder(java.lang.String imageAssetsFolder)
recycleBitmaps() when you
are done. Calling recycleBitmaps() doesn't have to be final and LottieDrawable
will recreate the bitmaps if needed but they will leak if you don't recycle them.public void recycleBitmaps()
LottieDrawable directly, you must call this yourself.
Calling recycleBitmaps() doesn't have to be final and LottieDrawable
will recreate the bitmaps if needed but they will leak if you don't recycle them.public void invalidateSelf()
invalidateSelf in class android.graphics.drawable.Drawablepublic void draw(android.graphics.Canvas canvas)
public int getIntrinsicWidth()
getIntrinsicWidth in class android.graphics.drawable.Drawablepublic int getIntrinsicHeight()
getIntrinsicHeight in class android.graphics.drawable.Drawablepublic void invalidateDrawable(android.graphics.drawable.Drawable who)
invalidateDrawable in interface android.graphics.drawable.Drawable.Callbackpublic void scheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what,
long when)
scheduleDrawable in interface android.graphics.drawable.Drawable.Callbackpublic void unscheduleDrawable(android.graphics.drawable.Drawable who,
java.lang.Runnable what)
unscheduleDrawable in interface android.graphics.drawable.Drawable.Callbackpublic void setAlpha(int alpha)
setAlpha in class android.graphics.drawable.Drawablepublic int getAlpha()
getAlpha in class android.graphics.drawable.Drawablepublic void setColorFilter(android.graphics.ColorFilter colorFilter)
setColorFilter in class android.graphics.drawable.Drawablepublic int getOpacity()
getOpacity in class android.graphics.drawable.Drawablepublic void setProgress(float progress)