ImageRequest

class ImageRequest

Wrapper class of the ImageRequest class of coil to offer basic functionality to the image loading.

Functions

Link copied to clipboard
fun bitmapConfig(config: Bitmap.Config): ImageRequest
Link copied to clipboard
fun crossfade(enable: Boolean): ImageRequest
fun crossfade(durationMillis: Int): ImageRequest
Link copied to clipboard
fun error(drawable: Drawable?): ImageRequest
fun error(@DrawableRes drawableResId: Int): ImageRequest

Set the error drawable to use if the request fails.

Link copied to clipboard
fun fallback(drawable: Drawable?): ImageRequest
fun fallback(@DrawableRes drawableResId: Int): ImageRequest

Set the fallback drawable to use if image is null.

Link copied to clipboard
fun placeholder(drawable: Drawable?): ImageRequest
fun placeholder(@DrawableRes drawableResId: Int): ImageRequest

Set the placeholder drawable to use when the request starts.

Link copied to clipboard
fun size(@Px size: Int)
fun size(@Px width: Int, @Px height: Int)

Set the requested width/height.