skydoves / landscapist

🌻 A pluggable, highly optimized Jetpack Compose and Kotlin Multiplatform image loading library that fetches and displays network images with Glide, Coil, and Fresco.
https://skydoves.github.io/landscapist/
Apache License 2.0
2.14k stars 114 forks source link

Crossfade between loading states #573

Open TemMax opened 1 week ago

TemMax commented 1 week ago

Hi!

CrossfadePlugin seems to imply Crossfade animation between the described image loading states. In fact, Crossfade does not work as state -> state but as empty -> state. This is more like a bug.

Example:

CoilImage(
    modifier = Modifier.matchParentSize(),
    imageModel = { url },
    component = LocalImageComponent.current,
    previewPlaceholder = painterResource(id = Icons.ic_logo),
    loading = loadingPlaceholder,
    failure = failurePlaceholder,
)

In this example, I expect behavior: loadingPlaceholder crossfades to success/failure, but I get: loadingPlaceholder -> clear image box -> crossfade to success/failure.

skydoves commented 1 week ago

Hey @TemMax, it would be very helpful to provide any screenshot or video for this along with the details of the component parameter that you've used.