ImageLoader

interface ImageLoader

A service class that loads images by executing ImageRequests. Image loaders handle caching, data fetching, image decoding, request management, bitmap pooling, memory management, and more.

Image loaders are designed to be shareable and work best when you create a single instance and share it throughout your app.

Types

Builder
Link copied to clipboard
class Builder
Companion
Link copied to clipboard
object Companion

Functions

enqueue
Link copied to clipboard
abstract fun enqueue(request: ImageRequest): Disposable

Enqueue the request to be executed asynchronously.

execute
Link copied to clipboard
abstract suspend fun execute(request: ImageRequest): ImageResult

Execute the request in the current coroutine scope.

newBuilder
Link copied to clipboard
abstract fun newBuilder(): ImageLoader.Builder

Create an ImageLoader.Builder that shares the same resources and configuration as this image loader.

shutdown
Link copied to clipboard
abstract fun shutdown()

Shutdown this image loader.

Properties

bitmapPool
Link copied to clipboard
abstract val bitmapPool: BitmapPool

An object pool of reusable Bitmaps.

defaults
Link copied to clipboard
abstract val defaults: DefaultRequestOptions

The default options that are used to fill in unset ImageRequest values.

memoryCache
Link copied to clipboard
abstract val memoryCache: MemoryCache

An in-memory cache of recently loaded images.

Extensions

executeBlocking
Link copied to clipboard
fun ImageLoader.executeBlocking(request: ImageRequest): ImageResult

Execute the request and block the current thread until it completes.