Class BaseTarget<Z>
- java.lang.Object
-
- com.bumptech.glide.request.target.BaseTarget<Z>
-
- Type Parameters:
Z- The type of resource that will be received by this target.
- All Implemented Interfaces:
LifecycleListener,Target<Z>
- Direct Known Subclasses:
SimpleTarget,ViewTarget
@Deprecated public abstract class BaseTarget<Z> extends java.lang.Object implements Target<Z>
Deprecated.UseCustomViewTargetif loading the content into a view, the download API if in the background (http://bumptech.github.io/glide/doc/getting-started.html#background-threads), or a a fully implementedTargetfor any specialized use-cases. Using BaseView is unsafe if the user does not implementonLoadCleared(android.graphics.drawable.Drawable), resulting in recycled bitmaps being referenced from the UI and hard to root-cause crashes.A baseTargetfor loadingResources that provides basic or empty implementations for most methods.For maximum efficiency, clear this target when you have finished using or displaying the
Resourceloaded into it usingRequestManager.clear(Target).For loading
Resources intoViews,ViewTargetorImageViewTargetare preferable.
-
-
Field Summary
-
Fields inherited from interface com.bumptech.glide.request.target.Target
SIZE_ORIGINAL
-
-
Constructor Summary
Constructors Constructor Description BaseTarget()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RequestgetRequest()Deprecated.Retrieves the current request for this target, should not be called outside of Glide.voidonDestroy()Deprecated.Callback for whenFragment.onDestroy()} orActivity.onDestroy()is called.voidonLoadCleared(android.graphics.drawable.Drawable placeholder)Deprecated.A mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.voidonLoadFailed(android.graphics.drawable.Drawable errorDrawable)Deprecated.A mandatory lifecycle callback that is called when a load fails.voidonLoadStarted(android.graphics.drawable.Drawable placeholder)Deprecated.A lifecycle callback that is called when a load is started.voidonStart()Deprecated.Callback for whenFragment.onStart()} orActivity.onStart()is called.voidonStop()Deprecated.Callback for whenFragment.onStop()} orActivity.onStop()} is called.voidsetRequest(Request request)Deprecated.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, removeCallback
-
-
-
-
Method Detail
-
setRequest
public void setRequest(@Nullable Request request)Deprecated.Description copied from interface:TargetSets the current request for this target to retain, should not be called outside of Glide.- Specified by:
setRequestin interfaceTarget<Z>
-
getRequest
@Nullable public Request getRequest()
Deprecated.Description copied from interface:TargetRetrieves the current request for this target, should not be called outside of Glide.- Specified by:
getRequestin interfaceTarget<Z>
-
onLoadCleared
public void onLoadCleared(@Nullable android.graphics.drawable.Drawable placeholder)Deprecated.Description copied from interface:TargetA mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.You must ensure that any current Drawable received in
Target.onResourceReady(Object, Transition)is no longer used before redrawing the container (usually a View) or changing its visibility.- Specified by:
onLoadClearedin interfaceTarget<Z>- Parameters:
placeholder- The placeholder drawable to optionally show, or null.
-
onLoadStarted
public void onLoadStarted(@Nullable android.graphics.drawable.Drawable placeholder)Deprecated.Description copied from interface:TargetA 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 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.
- Specified by:
onLoadStartedin interfaceTarget<Z>- Parameters:
placeholder- The placeholder drawable to optionally show, or null.
-
onLoadFailed
public void onLoadFailed(@Nullable android.graphics.drawable.Drawable errorDrawable)Deprecated.Description copied from interface:TargetA mandatory lifecycle callback that is called when a load fails.Note - This may be called before
Target.onLoadStarted(android.graphics.drawable.Drawable)if the model object is null.You must ensure that any current Drawable received in
Target.onResourceReady(Object, Transition)is no longer used before redrawing the container (usually a View) or changing its visibility.- Specified by:
onLoadFailedin interfaceTarget<Z>- Parameters:
errorDrawable- The error drawable to optionally show, or null.
-
onStart
public void onStart()
Deprecated.Description copied from interface:LifecycleListenerCallback for whenFragment.onStart()} orActivity.onStart()is called.- Specified by:
onStartin interfaceLifecycleListener
-
onStop
public void onStop()
Deprecated.Description copied from interface:LifecycleListenerCallback for whenFragment.onStop()} orActivity.onStop()} is called.- Specified by:
onStopin interfaceLifecycleListener
-
onDestroy
public void onDestroy()
Deprecated.Description copied from interface:LifecycleListenerCallback for whenFragment.onDestroy()} orActivity.onDestroy()is called.- Specified by:
onDestroyin interfaceLifecycleListener
-
-