|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.request.target.BaseTarget<Z>
Z
- The type of resource that will be received by this target.public abstract class BaseTarget<Z>
A base Target
for loading Resource
s that provides basic or empty
implementations for most methods.
For maximum efficiency, clear this target when you have finished using or displaying the
Resource
loaded into it using
Glide.clear(Target)
.
For loading Resource
s into View
s,
ViewTarget
or ImageViewTarget
are preferable.
Field Summary |
---|
Fields inherited from interface com.bumptech.glide.request.target.Target |
---|
SIZE_ORIGINAL |
Constructor Summary | |
---|---|
BaseTarget()
|
Method Summary | |
---|---|
Request |
getRequest()
Retrieves the current request for this target, should not be called outside of Glide. |
void |
onDestroy()
Callback for when Fragment.onDestroy() } or Activity.onDestroy() is
called. |
void |
onLoadCleared(Drawable placeholder)
A lifecycle callback that is called when a load is cancelled and its resources are freed. |
void |
onLoadFailed(Exception e,
Drawable errorDrawable)
A lifecycle callback that is called when a load fails. |
void |
onLoadStarted(Drawable placeholder)
A lifecycle callback that is called when a load is started. |
void |
onStart()
Callback for when Fragment.onStart() } or Activity.onStart() is called. |
void |
onStop()
Callback for when Fragment.onStop() } or Activity.onStop() } is called. |
void |
setRequest(Request request)
Sets the current request for this target to retain, should not be called outside of Glide. |
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.request.target.Target |
---|
getSize, onResourceReady |
Constructor Detail |
---|
public BaseTarget()
Method Detail |
---|
public void setRequest(Request request)
setRequest
in interface Target<Z>
public Request getRequest()
getRequest
in interface Target<Z>
public void onLoadCleared(Drawable placeholder)
onLoadCleared
in interface Target<Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onLoadStarted(Drawable placeholder)
Note - This may not be called for every load, it is possible for example for loads to fail before the load starts (when the model object is null).
Note - This method may be called multiple times before any other lifecycle method is called. Loads can be paused and restarted due to lifecycle or connectivity events and each restart may cause a call here.
onLoadStarted
in interface Target<Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onLoadFailed(Exception e, Drawable errorDrawable)
Note - This may be called before Target.onLoadStarted(android.graphics.drawable.Drawable)
if the model
object is null.
onLoadFailed
in interface Target<Z>
e
- The exception causing the load to fail, or null if no exception occurred (usually because a decoder
simply returned null).errorDrawable
- The error drawable to optionally show, or null.public void onStart()
Fragment.onStart()
} or Activity.onStart()
is called.
onStart
in interface LifecycleListener
public void onStop()
Fragment.onStop()
} or Activity.onStop()
} is called.
onStop
in interface LifecycleListener
public void onDestroy()
Fragment.onDestroy()
} or Activity.onDestroy()
is
called.
onDestroy
in interface LifecycleListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |