public class XmlDrawableDecoder extends VectorDecoder
Decoder.SOURCE
ENABLE_HARD_CACHE, resourceId, sourceType
Constructor and Description |
---|
XmlDrawableDecoder(android.content.res.Resources resources,
int resourceId) |
XmlDrawableDecoder(android.content.res.Resources resources,
android.net.Uri uri) |
Modifier and Type | Method and Description |
---|---|
android.graphics.drawable.Drawable |
compatGetDrawable(int resourceId) |
static VectorDrawableCompat |
create(android.content.res.Resources res,
int resId,
android.content.res.Resources.Theme theme)
Create a VectorDrawableCompat object.
|
protected android.graphics.Bitmap |
decodeAsBitmap(int boundsWidth,
int boundsHeight,
android.graphics.RectF slice,
DrawableState state) |
protected ImageSize |
decodeSize() |
void |
freeUpDrawableCache(android.graphics.drawable.Drawable drawable) |
android.graphics.drawable.Drawable |
getDrawable() |
boolean |
isStateful() |
void |
recycle() |
calculateImageSlice, getBitmap, getBitmap, isVector
createCache, fallbackCrop, finalize, getInputStream, getInputStream, getResources, getSize, getUncachedInputStream, getUri, resourceToUri
public XmlDrawableDecoder(@NonNull android.content.res.Resources resources, int resourceId)
public XmlDrawableDecoder(@NonNull android.content.res.Resources resources, @NonNull android.net.Uri uri)
protected ImageSize decodeSize()
decodeSize
in class Decoder
public boolean isStateful()
isStateful
in class Decoder
@Nullable protected android.graphics.Bitmap decodeAsBitmap(int boundsWidth, int boundsHeight, @Nullable android.graphics.RectF slice, @Nullable DrawableState state)
decodeAsBitmap
in class VectorDecoder
public void freeUpDrawableCache(android.graphics.drawable.Drawable drawable)
public android.graphics.drawable.Drawable compatGetDrawable(int resourceId)
@Nullable public static VectorDrawableCompat create(@NonNull android.content.res.Resources res, @DrawableRes int resId, @Nullable android.content.res.Resources.Theme theme)
res
- the resources.resId
- the resource ID for VectorDrawableCompat object.theme
- the theme of this vector drawable, it can be null.@Nullable @WorkerThread public android.graphics.drawable.Drawable getDrawable()
getDrawable
in class Decoder