val painter = rememberImagePainter(
data = url,
builder = {
crossfade(true) //Crossfade animation between images
placeholder(R.drawable.ic_image_loading) //Used while loading
fallback(R.drawable.ic_empty) //Used if data is null
error(R.drawable.ic_empty) //Used when loading returns with error
}
)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter