Z
- The type of resource that will be received by this target.CustomViewTarget
if 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
implemented Target
for any specialized use-cases. Using BaseView is unsafe if the
user does not implement onLoadCleared(android.graphics.drawable.Drawable)
, resulting in recycled bitmaps being
referenced from the UI and hard to root-cause crashes.@Deprecated public abstract class BaseTarget<Z> extends Object implements Target<Z>
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 RequestManager.clear(Target)
.
For loading Resource
s into View
s,
ViewTarget
or ImageViewTarget
are preferable.
SIZE_ORIGINAL
构造器和说明 |
---|
BaseTarget()
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
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 mandatory lifecycle callback that is called when a load is cancelled and its resources
are freed.
|
void |
onLoadFailed(Drawable errorDrawable)
已过时。
A mandatory 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSize, onResourceReady, removeCallback
public void setRequest(@Nullable Request request)
Target
setRequest
在接口中 Target<Z>
@Nullable public Request getRequest()
Target
getRequest
在接口中 Target<Z>
public void onLoadCleared(@Nullable Drawable placeholder)
Target
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.
onLoadCleared
在接口中 Target<Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onLoadStarted(@Nullable Drawable placeholder)
Target
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
在接口中 Target<Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onLoadFailed(@Nullable Drawable errorDrawable)
Target
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.
onLoadFailed
在接口中 Target<Z>
errorDrawable
- The error drawable to optionally show, or null.public void onStart()
LifecycleListener
Fragment.onStart()
} or Activity.onStart()
is called.onStart
在接口中 LifecycleListener
public void onStop()
LifecycleListener
Fragment.onStop()
} or Activity.onStop()
} is called.onStop
在接口中 LifecycleListener
public void onDestroy()
LifecycleListener
Fragment.onDestroy()
} or Activity.onDestroy()
is called.onDestroy
在接口中 LifecycleListener