com.duowan.mobile.netroid.toolbox
Interface ImageLoader.ImageListener

Enclosing class:
ImageLoader

public static interface ImageLoader.ImageListener

Interface for the response handlers on image requests. The call flow is this: 1. Upon being attached to a request, onSuccess(response, true) will be invoked to reflect any cached data that was already available. If the data was available, response.getBitmap() will be non-null. 2. After a network response returns, only one of the following cases will happen: - onSuccess(response, false) will be called if the image was loaded. or - onError will be called if there was an error loading the image.


Method Summary
 void onError(NetroidError error)
          Callback method that an error has been occurred with the provided error code and optional user-readable message.
 void onSuccess(ImageLoader.ImageContainer response, boolean isImmediate)
          Listens for non-error changes to the loading of the image request.
 

Method Detail

onSuccess

void onSuccess(ImageLoader.ImageContainer response,
               boolean isImmediate)
Listens for non-error changes to the loading of the image request.

Parameters:
response - Holds all information pertaining to the request, as well as the bitmap (if it is loaded).
isImmediate - True if this was called during ImageLoader.get() variants. This can be used to differentiate between a cached image loading and a network image loading in order to, for example, run an animation to fade in network loaded images.

onError

void onError(NetroidError error)
Callback method that an error has been occurred with the provided error code and optional user-readable message.