public interface ImageLoader
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ImageLoader.Callback
Listener callback that can be used to listen whether the loading process for a specific
ImageLoader.Task has been finished successfully or has failed. |
static class |
ImageLoader.Error
Error exception that will be dispatched by
ImageLoader if some error occurs during
loading process. |
static interface |
ImageLoader.Task<Target,Transformation>
Task used to specify set of desired parameters necessary for image loading process.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroys this image loader implementation.
|
android.graphics.Bitmap |
load(ImageLoader.Task task)
Performs synchronous loading of a desired image bitmap using the specified task.
|
boolean |
load(ImageLoader.Task task,
ImageLoader.Callback callback)
Performs asynchronous loading of a desired image bitmap using the specified task.
|
void |
onLowMemory()
Called due to call to
Activity.onLowMemory() or Fragment.onLowMemory() of the
activity or fragment that uses this image loader. |
void |
onTrimMemory(int level)
Called due to call to
Activity.onTrimMemory(int) or Fragment.onTrimMemory(int)
of the activity or fragment that uses this image loader. |
void |
pause()
Pauses this image loader implementation.
|
boolean |
remove(ImageLoader.Task task)
Performs synchronous removing of a desired image bitmap using the specified task.
|
void |
resume()
Resumes this image loader implementation.
|
void |
start()
Starts this image loader implementation.
|
void |
stop()
Stops this image loader implementation.
|
void start()
void resume()
Depending on implementation, this should resume all previously paused image tasks.
pause()void pause()
Depending on implementation, this should pause all currently running image tasks in a way where
they may be resumed via call to resume().
resume()void stop()
Depending on implementation, this should stop all currently running image tasks.
start()void destroy()
Depending on implementation, this should stop all currently running image tasks.
boolean load(@NonNull
ImageLoader.Task task,
@Nullable
ImageLoader.Callback callback)
task - The task that specifies necessary parameters for the loading process.callback - Callback to be invoked whenever the loading process is finished successfully
or due to some error.True if loading process has been initiated, false if some error has
occurred.@Nullable
android.graphics.Bitmap load(@NonNull
ImageLoader.Task task)
task - The task that specifies necessary parameters for the loading process.null if loading process has failed.ImageLoader.Error - If some loader related error occurs during the loading process.boolean remove(@NonNull
ImageLoader.Task task)
task - The task that specifies necessary parameters for the removing process.True if image bitmap has been successfully removed from the cache (either
memory, disk or both), false if there was no bitmap to remove.void onLowMemory()
Activity.onLowMemory() or Fragment.onLowMemory() of the
activity or fragment that uses this image loader.
Depending on implementation, this image loader should trim the memory used to store loaded
bitmaps the same way as for call to onTrimMemory(int) with TRIM_MEMORY_COMPLETE.
void onTrimMemory(int level)
Activity.onTrimMemory(int) or Fragment.onTrimMemory(int)
of the activity or fragment that uses this image loader.
Depending on implementation, this image loader should trim the memory used to store loaded bitmaps according to the requested level.
level - The level for which should this image loader implementation trim the memory.