-
- All Implemented Interfaces:
-
com.mobwith.imgmodule.manager.LifecycleListener,com.mobwith.imgmodule.request.target.Target
@Deprecated() public abstract class BaseTarget<Z> implements Target<Z>
A base Target for loading com.mobwith.imgmodule.load.engine.Resources that provides basic or empty implementations for most methods.
For maximum efficiency, clear this target when you have finished using or displaying the com.mobwith.imgmodule.load.engine.Resource loaded into it using .
For loading com.mobwith.imgmodule.load.engine.Resources into android.view.Views, com.mobwith.imgmodule.request.target.ViewTarget or are preferable.
-
-
Method Summary
Modifier and Type Method Description RequestgetRequest()Retrieves the current request for this target, should not be called outside of ImageModule. voidsetRequest(@Nullable() Request request)Sets the current request for this target to retain, should not be called outside of ImageModule. voidonLoadCleared(@Nullable() Drawable placeholder)A mandatory lifecycle callback that is called when a load is cancelled and its resourcesare freed. voidonLoadStarted(@Nullable() Drawable placeholder)A lifecycle callback that is called when a load is started. voidonLoadFailed(@Nullable() Drawable errorDrawable)A mandatory lifecycle callback that is called when a load fails. voidonStart()Callback for when onStart} or is called. voidonStop()Callback for when onStop} or } is called. voidonDestroy()Callback for when onDestroy} or is called. -
-
Method Detail
-
getRequest
@Nullable() Request getRequest()
Retrieves the current request for this target, should not be called outside of ImageModule.
-
setRequest
void setRequest(@Nullable() Request request)
Sets the current request for this target to retain, should not be called outside of ImageModule.
-
onLoadCleared
void onLoadCleared(@Nullable() Drawable placeholder)
A mandatory lifecycle callback that is called when a load is cancelled and its resourcesare freed.
You must ensure that any current Drawable received in onResourceReady is no longer used before redrawing the container (usually a View) or changing itsvisibility.
- Parameters:
placeholder- The placeholder drawable to optionally show, or null.
-
onLoadStarted
void onLoadStarted(@Nullable() Drawable placeholder)
A lifecycle callback that is called when a load is started.
Note - This may not be called for every load, it is possible for example for loads to failbefore 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 maycause a call here.
- Parameters:
placeholder- The placeholder drawable to optionally show, or null.
-
onLoadFailed
void onLoadFailed(@Nullable() Drawable errorDrawable)
A mandatory lifecycle callback that is called when a load fails.
Note - This may be called before onLoadStarted if the model object is null.
You must ensure that any current Drawable received in onResourceReady is no longer used before redrawing the container (usually a View) or changing itsvisibility.
- Parameters:
errorDrawable- The error drawable to optionally show, or null.
-
-
-
-