com.bumptech.glide.request.target
Class GlideDrawableImageViewTarget

java.lang.Object
  extended by com.bumptech.glide.request.target.BaseTarget<Z>
      extended by com.bumptech.glide.request.target.ViewTarget<ImageView,Z>
          extended by com.bumptech.glide.request.target.ImageViewTarget<GlideDrawable>
              extended by com.bumptech.glide.request.target.GlideDrawableImageViewTarget
All Implemented Interfaces:
LifecycleListener, GlideAnimation.ViewAdapter, Target<GlideDrawable>

public class GlideDrawableImageViewTarget
extends ImageViewTarget<GlideDrawable>

A Target that can display an Drawable in an ImageView.


Field Summary
 
Fields inherited from class com.bumptech.glide.request.target.ViewTarget
view
 
Fields inherited from interface com.bumptech.glide.request.target.Target
SIZE_ORIGINAL
 
Constructor Summary
GlideDrawableImageViewTarget(ImageView view)
          Constructor for an Target that can display an GlideDrawable in an ImageView.
GlideDrawableImageViewTarget(ImageView view, int maxLoopCount)
          Constructor for an Target that can display an GlideDrawable in an ImageView.
 
Method Summary
 void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation)
          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.
protected  void setResource(GlideDrawable resource)
          Sets the drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
 
Methods inherited from class com.bumptech.glide.request.target.ImageViewTarget
getCurrentDrawable, onLoadCleared, onLoadFailed, onLoadStarted, setDrawable
 
Methods inherited from class com.bumptech.glide.request.target.ViewTarget
getRequest, getSize, getView, setRequest, setTagId, toString
 
Methods inherited from class com.bumptech.glide.request.target.BaseTarget
onDestroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bumptech.glide.request.animation.GlideAnimation.ViewAdapter
getView
 

Constructor Detail

GlideDrawableImageViewTarget

public GlideDrawableImageViewTarget(ImageView view)
Constructor for an Target that can display an GlideDrawable in an ImageView.

Parameters:
view - The view to display the drawable in.

GlideDrawableImageViewTarget

public GlideDrawableImageViewTarget(ImageView view,
                                    int maxLoopCount)
Constructor for an Target that can display an GlideDrawable in an ImageView.

Parameters:
view - The view to display the drawable in.
maxLoopCount - A value to pass to to GlideDrawables indicating how many times they should repeat their animation (if they have one). See GlideDrawable.setLoopCount(int).
Method Detail

onResourceReady

public void onResourceReady(GlideDrawable resource,
                            GlideAnimation<? super GlideDrawable> animation)
The method that will be called when the resource load has finished. If no GlideAnimation is given or if the animation does not set the Drawable on the view, the drawable is set using ImageView.setImageDrawable(android.graphics.drawable.Drawable).

Specified by:
onResourceReady in interface Target<GlideDrawable>
Overrides:
onResourceReady in class ImageViewTarget<GlideDrawable>
Parameters:
resource - the loaded resource.
animation -

setResource

protected void setResource(GlideDrawable resource)
Sets the drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).

Specified by:
setResource in class ImageViewTarget<GlideDrawable>
Parameters:
resource - The Drawable to display in the view.

onStart

public void onStart()
Description copied from class: BaseTarget
Callback for when Fragment.onStart()} or Activity.onStart() is called.

Specified by:
onStart in interface LifecycleListener
Overrides:
onStart in class BaseTarget<GlideDrawable>

onStop

public void onStop()
Description copied from class: BaseTarget
Callback for when Fragment.onStop()} or Activity.onStop()} is called.

Specified by:
onStop in interface LifecycleListener
Overrides:
onStop in class BaseTarget<GlideDrawable>