Class DrawableResource<T extends android.graphics.drawable.Drawable>
- java.lang.Object
-
- com.bumptech.glide.load.resource.drawable.DrawableResource<T>
-
- Type Parameters:
T- type of the wrappedDrawable
- All Implemented Interfaces:
Initializable,Resource<T>
- Direct Known Subclasses:
BitmapDrawableResource,GifDrawableResource
public abstract class DrawableResource<T extends android.graphics.drawable.Drawable> extends java.lang.Object implements Resource<T>, Initializable
Simple wrapper for an AndroidDrawablewhich returns anew drawablebased on it'sstate.Suggested usages only include
Ts where the new drawable is of the same or descendant class.
-
-
Constructor Summary
Constructors Constructor Description DrawableResource(T drawable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Returns an instance of the wrapped resource.voidinitialize()Called on a background thread so theResourcecan do some eager initialization.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.bumptech.glide.load.engine.Resource
getResourceClass, getSize, recycle
-
-
-
-
Field Detail
-
drawable
protected final T extends android.graphics.drawable.Drawable drawable
-
-
Constructor Detail
-
DrawableResource
public DrawableResource(T drawable)
-
-
Method Detail
-
get
@NonNull public final T get()
Description copied from interface:ResourceReturns an instance of the wrapped resource.Note - This does not have to be the same instance of the wrapped resource class and in fact it is often appropriate to return a new instance for each call. For example,
Drawables should only be used by a singleViewat a time so each call to this method for Resources that wrapDrawables should always return a newDrawable.
-
initialize
public void initialize()
Description copied from interface:InitializableCalled on a background thread so theResourcecan do some eager initialization.- Specified by:
initializein interfaceInitializable
-
-