https://kotlinlang.org logo
#android
Title
# android
s

svenjacobs

01/20/2020, 7:12 AM
Hi, anyone here who migrated from Glide image loading library to Coil? I'm considering replacing Glide due to performance reasons. Animations stutter when Glide loads an image at the same time. I'm wondering if Coil handles this better?
l

louiscad

01/22/2020, 4:32 PM
Hey, I got answers from a private Slack for you: Person A:
That's a super vague question :)
Main thread work from image loading probably depends drastically on the image size, device ram/memory pressure, animations being run, etc
Person B (library author):
Glide uses a
TransitionDrawable
to perform the crossfade whereas Coil uses a custom
CrossfadeDrawable
(https://github.com/coil-kt/coil/blob/master/coil-base/src/main/java/coil/drawable/CrossfadeDrawable.kt) since it allows listening to animation completion (and a few other reasons).
The
onDraw
calls of
TransitionDrawable
and
CrossfadeDrawable
are very similar.
s

svenjacobs

01/23/2020, 7:37 AM
Thanks for the response. I use Glide inside a RecyclerView.Adapter to load images when the view is bound. When I play an animation at the same time Glide loads an image, the animation stutters. This even happens when Glide loads the image from cache. When I deactive the Glide call, the animation runs smoothly. This even happens on high end devices like the Google Pixel 4 XL.
The animated view is not the same view where the image is loaded into
16 Views