Z
- The type of resource that will be loaded into memory.public final class PreloadTarget<Z> extends CustomTarget<Z>
Target
class that loads a resource into
memory and then clears itself.SIZE_ORIGINAL
Modifier and Type | Method and Description |
---|---|
static <Z> PreloadTarget<Z> |
obtain(RequestManager requestManager,
int width,
int height)
Returns a PreloadTarget.
|
void |
onLoadCleared(android.graphics.drawable.Drawable placeholder)
A mandatory lifecycle callback that is called when a load is cancelled and its resources
are freed.
|
void |
onResourceReady(Z resource,
Transition<? super Z> transition)
The method that will be called when the resource load has finished.
|
getRequest, getSize, onDestroy, onLoadFailed, onLoadStarted, onStart, onStop, removeCallback, setRequest
public static <Z> PreloadTarget<Z> obtain(RequestManager requestManager, int width, int height)
Z
- The type of the desired resource.width
- The width in pixels of the desired resource.height
- The height in pixels of the desired resource.public void onResourceReady(@NonNull Z resource, @Nullable Transition<? super Z> transition)
Target
resource
- the loaded resource.public void onLoadCleared(@Nullable android.graphics.drawable.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.
placeholder
- The placeholder drawable to optionally show, or null.