Z - The type of resource that this target will receive.public abstract class SimpleTarget<Z> extends BaseTarget<Z>
Target base class with default (usually noop)
implementations of non essential methods that allows the caller to specify an exact width/height.
Typically use cases look something like this:
Glide.load("http://somefakeurl.com/fakeImage.jpeg")
.asBitmap()
.withFitCenter()
.into(new SimpleTarget(250, 250) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
// Do something with bitmap here.
}
});
}
SIZE_ORIGINAL| Constructor and Description |
|---|
SimpleTarget()
Constructor for the target that uses
Target.SIZE_ORIGINAL as the target width and
height. |
SimpleTarget(int width,
int height)
Constructor for the target that takes the desired dimensions of the decoded and/or transformed
resource.
|
| Modifier and Type | Method and Description |
|---|---|
void |
getSize(SizeReadyCallback cb)
Immediately calls the given callback with the sizes given in the constructor.
|
void |
removeCallback(SizeReadyCallback cb)
Removes the given callback from the pending set if it's still retained.
|
getRequest, onDestroy, onLoadCleared, onLoadFailed, onLoadStarted, onStart, onStop, setRequestclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonResourceReadypublic SimpleTarget()
Target.SIZE_ORIGINAL as the target width and
height.public SimpleTarget(int width,
int height)
width - The width in pixels of the desired resource.height - The height in pixels of the desired resource.public final void getSize(SizeReadyCallback cb)
cb - The callback that must be called when the size of the target has been determinedpublic void removeCallback(SizeReadyCallback cb)
Targetcb - The callback to remove.