Skip to content

Image Requests

ImageRequests are value objects that provide all the necessary information for an ImageLoader to load an image. ImageRequests can be created using a builder:

val request = ImageRequest.Builder(context)
    .data("https://example.com/image.jpg")
    .crossfade(true)
    .target(imageView)
    .build()

Once you've created a request pass it to an ImageLoader to enqueue/execute it:

imageLoader.enqueue(request)

See the API documentation for more information.

Notes

In Coil 3.x ImageRequest's platform-specific functions (e.g. ImageRequest.Builder.target(ImageView)) are implemented as extension functions and need to be imported separately.