java.lang.Object | |||
↳ | android.view.View | ||
↳ | android.widget.ImageView | ||
↳ | greendroid.widget.AsyncImageView |
A AsyncImageView
is a network-aware ImageView. It may display images
from the web according to a URL. AsyncImageView
takes care of loading
asynchronously images on the Internet. It also caches images in an
application-wide cache to prevent loading images several times.
Clients may listen the AsyncImageView.OnImageViewLoadListener
to be notified of the
current image loading state.
AsyncImageView
may be extremely useful in ListView's row. To prevent
your AsyncImageView
from downloading while scrolling or flinging it
is a good idea to pause it using setPaused(boolean)
method. Once the
scrolling/flinging is over, un-pause your AsyncImageView
s
using setPaused(false)
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AsyncImageView.OnImageViewLoadListener | Clients may listen to AsyncImageView changes using a
AsyncImageView.OnImageViewLoadListener . |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.view.View
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return true if the displayed image has been correctly loaded.
| |||||||||||
Return true if this AsyncImageView is currently loading an image.
| |||||||||||
Callback to be invoked when the request processing has been
cancelled.
| |||||||||||
Callback to be invoked when the request processing ended.
| |||||||||||
Callback to be invoked when the request processing failed.
| |||||||||||
Callback to be invoked when the request processing started.
| |||||||||||
Reload the image pointed by the given URL
| |||||||||||
Reload the image pointed by the given URL.
| |||||||||||
Set the default bitmap as the content of this AsyncImageView
| |||||||||||
Set the default drawable as the content of this AsyncImageView
| |||||||||||
Set the default resource as the content of this AsyncImageView
| |||||||||||
Set an image processor to this AsyncImageView.
| |||||||||||
Helper to
setOptions(Options) that simply sets the inDensity for
loaded image. | |||||||||||
Register a callback to be invoked when an event occured for this
AsyncImageView.
| |||||||||||
Assign an Options object to this
AsyncImageView . | |||||||||||
Pause this AsyncImageView preventing it from downloading the image.
| |||||||||||
Set the url of the image that will be used as the content of this
AsyncImageView.
| |||||||||||
Force the loading to be stopped.
|
[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
| |||||||||||
From interface
greendroid.image.ImageRequest.ImageRequestCallback
|
Return true if the displayed image has been correctly loaded.
Return true if this AsyncImageView is currently loading an image.
Callback to be invoked when the request processing has been cancelled.
request | ImageRequest that has been cancelled |
---|
Callback to be invoked when the request processing ended.
request | ImageRequest that ended |
---|---|
image | The resulting Bitmap |
Callback to be invoked when the request processing failed.
request | ImageRequest that failed |
---|---|
throwable | The Throwable that occurs |
Callback to be invoked when the request processing started.
request | The ImageRequest that started |
---|
Reload the image pointed by the given URL
Reload the image pointed by the given URL. You may want to force reloading by setting the force parameter to true.
force | if true the AsyncImageView won't look into the application-wide cache. |
---|
Set the default bitmap as the content of this AsyncImageView
bitmap | The bitmap to set |
---|
Set the default drawable as the content of this AsyncImageView
drawable | The drawable to set |
---|
Set the default resource as the content of this AsyncImageView
resId | The resource identifier to set |
---|
Set an image processor to this AsyncImageView. An ImageProcessor may be used in order to work on the retrieved Bitmap prior displaying it on screen.
imageProcessor | The ImageProcessor to set |
---|
Helper to setOptions(Options)
that simply sets the inDensity for
loaded image.
Register a callback to be invoked when an event occured for this AsyncImageView.
listener | The listener that will be notified |
---|
Assign an Options object to this AsyncImageView
. Those options
are used internally by the AsyncImageView
when decoding the
image. This may be used to prevent the default behavior that loads all
images as mdpi density.
Pause this AsyncImageView preventing it from downloading the image. The download process will start back once setPaused(false) is called.
Set the url of the image that will be used as the content of this
AsyncImageView. The given may be null in order to display the default
image. Please note the url may be a local url. For instance, you can
asynchronously load images from the disk memory is the url scheme is
file://
url | The url of the image to set. Pass null to force the AsyncImageView to display the default image |
---|
Force the loading to be stopped.