Coil

object Coil

A class that holds the singleton ImageLoader instance.

Functions

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

Convenience function to get the singleton ImageLoader and enqueue the request.

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

Convenience function to get the singleton ImageLoader and execute the request.

imageLoader
Link copied to clipboard
fun imageLoader(context: Context): ImageLoader

Get the singleton ImageLoader. Creates a new instance if none has been set.

setImageLoader
Link copied to clipboard
fun setImageLoader(imageLoader: ImageLoader)

Set the singleton ImageLoader. Prefer using setImageLoader(ImageLoaderFactory) to create the ImageLoader lazily.

fun setImageLoader(factory: ImageLoaderFactory)

Set the ImageLoaderFactory that will be used to create the singleton ImageLoader. The factory is guaranteed to be called at most once.