public class

NetworkImageView

extends ImageView
java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ImageView
       ↳ com.android.volley.toolbox.NetworkImageView

Class Overview

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

Summary

[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
NetworkImageView(Context context)
NetworkImageView(Context context, AttributeSet attrs)
NetworkImageView(Context context, AttributeSet attrs, int defStyle)
Public Methods
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.
Protected Methods
void drawableStateChanged()
void onDetachedFromWindow()
void onLayout(boolean changed, int left, int top, int right, int bottom)
[Expand]
Inherited Methods
From class android.widget.ImageView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public NetworkImageView (Context context)

public NetworkImageView (Context context, AttributeSet attrs)

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

Public Methods

public void setDefaultImageResId (int defaultImage)

Sets the default image resource ID to be used for this view until the attempt to load it completes.

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.

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.

Protected Methods

protected void drawableStateChanged ()

protected void onDetachedFromWindow ()

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