ImageLoader

interface ImageLoader

A service class that loads images by executing ImageRequests. Image loaders handle caching, data fetching, image decoding, request management, 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

Link copied to clipboard
class Builder

Properties

Link copied to clipboard

The components used to fulfil image requests.

Link copied to clipboard

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

Link copied to clipboard
abstract val diskCache: DiskCache?

An on-disk cache of previously loaded images.

Link copied to clipboard
abstract val memoryCache: MemoryCache?

An in-memory cache of previously loaded images.

Functions

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

Enqueue the request to be executed asynchronously.

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

Execute the request in the current coroutine scope.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
abstract fun shutdown()

Cancel any new and in progress requests, clear the MemoryCache, and close any open system resources.