com.android.volley.toolbox
Class NetworkImageView

java.lang.Object
  extended by ImageView
      extended by com.android.volley.toolbox.NetworkImageView

public class NetworkImageView
extends ImageView

Handles fetching an image from a URL as well as the life-cycle of the associated request.


Constructor Summary
NetworkImageView(Context context)
           
NetworkImageView(Context context, AttributeSet attrs)
           
NetworkImageView(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
protected  void drawableStateChanged()
           
protected  void onDetachedFromWindow()
           
protected  void onLayout(boolean changed, int left, int top, int right, int bottom)
           
 void setDefaultImageResId(int defaultImage)
          Sets the default image resource ID to be used for this view until the attempt to load it completes.
 void setErrorImageResId(int errorImage)
          Sets the error image resource ID to be used for this view in the event that the image requested fails to load.
 void setImageUrl(String url, ImageLoader imageLoader)
          Sets URL of the image that should be loaded into this view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkImageView

public NetworkImageView(Context context)

NetworkImageView

public NetworkImageView(Context context,
                        AttributeSet attrs)

NetworkImageView

public NetworkImageView(Context context,
                        AttributeSet attrs,
                        int defStyle)
Method Detail

setImageUrl

public void setImageUrl(String url,
                        ImageLoader imageLoader)
Sets URL of the image that should be loaded into this view. Note that calling this will immediately either set the cached image (if available) or the default image specified by setDefaultImageResId(int) on the view. NOTE: If applicable, setDefaultImageResId(int) and setErrorImageResId(int) should be called prior to calling this function.

Parameters:
url - The URL that should be loaded into this ImageView.
imageLoader - ImageLoader that will be used to make the request.

setDefaultImageResId

public void setDefaultImageResId(int defaultImage)
Sets the default image resource ID to be used for this view until the attempt to load it completes.


setErrorImageResId

public void setErrorImageResId(int errorImage)
Sets the error image resource ID to be used for this view in the event that the image requested fails to load.


onLayout

protected void onLayout(boolean changed,
                        int left,
                        int top,
                        int right,
                        int bottom)

onDetachedFromWindow

protected void onDetachedFromWindow()

drawableStateChanged

protected void drawableStateChanged()