Z
- The type of resource that this target will display in the wrapped ImageView
.public abstract class ImageViewTarget<Z> extends ViewTarget<android.widget.ImageView,Z> implements Transition.ViewAdapter
Target
for displaying resources in ImageView
s.view
SIZE_ORIGINAL
Constructor and Description |
---|
ImageViewTarget(android.widget.ImageView view) |
ImageViewTarget(android.widget.ImageView view,
boolean waitForLayout)
Deprecated.
Use
ViewTarget.waitForLayout() instead. |
Modifier and Type | Method and Description |
---|---|
android.graphics.drawable.Drawable |
getCurrentDrawable()
Returns the current
Drawable being displayed in the view
using ImageView.getDrawable() . |
void |
onLoadCleared(android.graphics.drawable.Drawable placeholder)
Sets the given
Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable) . |
void |
onLoadFailed(android.graphics.drawable.Drawable errorDrawable)
Sets the given
Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable) . |
void |
onLoadStarted(android.graphics.drawable.Drawable placeholder)
Sets the given
Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable) . |
void |
onResourceReady(Z resource,
Transition<? super Z> transition)
The method that will be called when the resource load has finished.
|
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 |
setDrawable(android.graphics.drawable.Drawable drawable)
Sets the given
Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable) . |
protected abstract void |
setResource(Z resource) |
clearOnDetach, getRequest, getSize, getView, removeCallback, setRequest, setTagId, toString, waitForLayout
onDestroy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getView
public ImageViewTarget(android.widget.ImageView view)
@Deprecated public ImageViewTarget(android.widget.ImageView view, boolean waitForLayout)
ViewTarget.waitForLayout()
instead.@Nullable public android.graphics.drawable.Drawable getCurrentDrawable()
Drawable
being displayed in the view
using ImageView.getDrawable()
.getCurrentDrawable
in interface Transition.ViewAdapter
public void setDrawable(android.graphics.drawable.Drawable drawable)
Drawable
on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable)
.setDrawable
in interface Transition.ViewAdapter
drawable
- The drawable to display in the wrapped view.public void onLoadStarted(@Nullable android.graphics.drawable.Drawable placeholder)
Drawable
on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable)
.onLoadStarted
in interface Target<Z>
onLoadStarted
in class ViewTarget<android.widget.ImageView,Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onLoadFailed(@Nullable android.graphics.drawable.Drawable errorDrawable)
Drawable
on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable)
.onLoadFailed
in interface Target<Z>
onLoadFailed
in class BaseTarget<Z>
errorDrawable
- The error drawable to optionally show, or null.public void onLoadCleared(@Nullable android.graphics.drawable.Drawable placeholder)
Drawable
on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable)
.onLoadCleared
in interface Target<Z>
onLoadCleared
in class ViewTarget<android.widget.ImageView,Z>
placeholder
- The placeholder drawable to optionally show, or null.public void onResourceReady(@NonNull Z resource, @Nullable Transition<? super Z> transition)
Target
onResourceReady
in interface Target<Z>
resource
- the loaded resource.public void onStart()
LifecycleListener
Fragment.onStart()
} or Activity.onStart()
is called.onStart
in interface LifecycleListener
onStart
in class BaseTarget<Z>
public void onStop()
LifecycleListener
Fragment.onStop()
} or Activity.onStop()
} is called.onStop
in interface LifecycleListener
onStop
in class BaseTarget<Z>
protected abstract void setResource(@Nullable Z resource)