When loading images with Coil through Accompanist,...
# compose
j
When loading images with Coil through Accompanist, what is the difference using Coil’s
crossfade
and/or Accompanist’s
fadeIn
?
Copy code
Image(
  painter = rememberCoilPainter(
    request = "<http://www.image.com|www.image.com>",
    requestBuilder = {
      crossfade(true) // <-- Should I use this?
      placeholder(R.drawable.something)
      error(R.drawable.something_else)
    },
    fadeIn = true, // <-- Or this?
  ),
  contentDescription = null
)
a
AFAIK Coil's
crossfade
uses its own
CrossfadeDrawable
to wrap the actual bitmap, which has no effect in Compose UI.
🙏 1
c
Yep exactly, but I think that Coil's
crossfade
does actually work. That said, crossfade is a very basic fade, unlike the one provided in
rememberCoilPainter()
🙏 1