|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface StreamLoader
A base class for lazily and asynchronously opening an input stream that can be used to load an image.
A new instance is created per image load by ModelLoader. loadStream
may or may not be called for any given load depending on whether or not the corresponding image is cached. Cancel
also may or may not be called.
| Nested Class Summary | |
|---|---|
static interface |
StreamLoader.StreamReadyCallback
An interface defining a callback for when an InputStream has been opened successfully or the load has failed because of an exception. |
| Method Summary | |
|---|---|
void |
cancel()
A method that will be called by an ImagePresenter when a load is no longer
relevant (because we now want to load a different image into the view). |
void |
loadStream(StreamLoader.StreamReadyCallback cb)
Asynchronously fetch and open an InputStream representing an image. |
| Method Detail |
|---|
void loadStream(StreamLoader.StreamReadyCallback cb)
ExecutorService that may have more than one background thread.
This method will only be called when the corresponding image is not in the cache.
cb - The callback to call when the load completes or fails due to an exceptionvoid cancel()
ImagePresenter when a load is no longer
relevant (because we now want to load a different image into the view). This method does not need to guarantee
that any in process loads do not finish. It also may be called before a load starts or after it finishes.
The best way to use this method is to cancel any loads that have not yet started, but allow those that are in
process to finish since its we typically will want to display the same image in a different view in
the near future.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||