com.bumptech.glide.load.resource.drawable
Class DrawableResource<T extends Drawable>
java.lang.Object
com.bumptech.glide.load.resource.drawable.DrawableResource<T>
- Type Parameters:
T
- type of the wrapped Drawable
- All Implemented Interfaces:
- Resource<T>
- Direct Known Subclasses:
- BitmapDrawableResource, GifDrawableResource, GlideBitmapDrawableResource
public abstract class DrawableResource<T extends Drawable>
- extends Object
- implements Resource<T>
Simple wrapper for an Android Drawable
which returns a
new drawable
based on it's state
.
Suggested usages only include T
s where the new drawable is of the same or descendant class.
Method Summary |
T |
get()
Returns an instance of the wrapped resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
drawable
protected final T extends Drawable drawable
DrawableResource
public DrawableResource(T drawable)
get
public final T get()
- Description copied from interface:
Resource
- Returns 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,
Drawable
s should only be used by a single
View
at a time so each call to this method for Resources that wrap
Drawable
s should always return a new
Drawable
.
- Specified by:
get
in interface Resource<T extends Drawable>