bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

[compose] Glide Compose does not stop animations when the app is in background, leading to extensive CPU usage. #5440

Open mhozza opened 2 months ago

mhozza commented 2 months ago

Glide Version: head

Integration libraries: compose

Device/Android Version: all

Issue details / Repro steps / Use case background: Glide Compose does not stop animations when the app is in background, leading to extensive CPU usage.

The ImageViewTarget pauses the animation in onStop. The GlideImage should ideally do the same, preferably by default. Option to pause animation in onPause instead of onStop would also be useful.

Layout XML:

GlideImage(
        model = uri,
        contentDescription = ...,   
)