FutureTarget
An interface for an object that is both a com.bumptech.glide.request.target.Target and a java.util.concurrent.Future. For example:
FutureTarget<Bitmap> futureTarget = Glide.with(fragment)
.load("http://goo.gl/1asf12")
.asBitmap()
.into(250, 250);
Bitmap myBitmap = futureTarget.get();
... // do things with bitmap and then release when finished:
futureTarget.cancel(false);
Content copied to clipboard
Note - get and get must be called off of the main thread or they will block forever.
Parameters
<R>
The type of resource this FutureTarget will retrieve.
Functions
Link copied to clipboard
Retrieves the current request for this target, should not be called outside of Glide.
Link copied to clipboard
A method to retrieve the size of this target.
Link copied to clipboard
Link copied to clipboard
A mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.
Link copied to clipboard
A mandatory lifecycle callback that is called when a load fails.
Link copied to clipboard
A lifecycle callback that is called when a load is started.
Link copied to clipboard
abstract fun onResourceReady(resource: R, transition: Transition<out Any>)
Content copied to clipboard
The method that will be called when the resource load has finished.
Link copied to clipboard
Removes the given callback from the pending set if it's still retained.
Link copied to clipboard
Sets the current request for this target to retain, should not be called outside of Glide.