T - type of the wrapped Drawablepublic abstract class DrawableResource<T extends android.graphics.drawable.Drawable> extends java.lang.Object implements Resource<T>, Initializable
Drawable which returns a new drawable based on it's state.
Suggested usages only include Ts where the new drawable is of the same or
descendant class.
| Constructor and Description |
|---|
DrawableResource(T drawable) |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Returns an instance of the wrapped resource.
|
void |
initialize()
Called on a background thread so the
Resource can do some eager initialization. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetResourceClass, getSize, recycleprotected final T extends android.graphics.drawable.Drawable drawable
public DrawableResource(T drawable)
@NonNull public final T get()
ResourceNote - 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 single View at a time so each call to this method for Resources that wrap Drawables should always return a new Drawable.
public void initialize()
InitializableResource can do some eager initialization.initialize in interface Initializable