Colton Idle
05/31/2021, 4:35 AMCrossfade()
?
The docs state that you CAN crossfade, but not exactly how? I also looked at Owl sample app but didn't see usage of crossfade either.Albert Chang
05/31/2021, 5:08 AMval painter = rememberCoilPainter(request = request)
Crossfade(targetState = painter.loadState is ImageLoadState.Success) { success ->
if (success) Image(painter = painter, contentDescription = contentDescription)
}
cb
05/31/2021, 10:18 AMCrossfade
then Albert’s answer is correct.Colton Idle
05/31/2021, 1:09 PMimageView.load("<https://www.example.com/image.jpg>") {
crossfade(true)
placeholder(R.drawable.image)
transformations(CircleCropTransformation())
}
Anyone know how I would use coil crossfade, or does it not make sense in a compose world and I should instead use composes crossfade?cb
06/02/2021, 10:29 PMTarget
interface required. Any reason why you’re not using fadeIn
?Colton Idle
06/02/2021, 11:23 PMval painter = rememberCoilPainter(request = imageUrl)
Crossfade(targetState = painter.loadState) {
when (it) {
ImageLoadState.Empty -> {}
is ImageLoadState.Loading -> {
Spacer(modifier = Modifier.matchParentSize().background(Color(0xffff0000)))
}
is ImageLoadState.Success -> {
Image(
painter = painter,
contentDescription = null,
contentScale = ContentScale.Crop,
alpha = alpha)
}
is ImageLoadState.Error -> {}
}
}
cb
06/08/2021, 6:36 AMCrossfade
doesn’t have a size? The match parent size is probably resolving to 0,0