bumptech / glide

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

How to disabled animation for cached images in compose? #5442

Open yaroslav-storozhik opened 1 month ago

yaroslav-storozhik commented 1 month ago

"com.github.bumptech.glide:compose", version = "1.0.0-beta01"

In clasic glide we can make cutom DrawableTransitionOption

fun optionalCrossFade(): DrawableTransitionOptions {
    return DrawableTransitionOptions.with { dataSource, isFirstResource ->
        if (dataSource == DataSource.DATA_DISK_CACHE || dataSource == DataSource.RESOURCE_DISK_CACHE || dataSource == DataSource.MEMORY_CACHE||dataSource==DataSource.LOCAL) {
            null
        } else {
            DrawableCrossFadeFactory.Builder(300).build()
                .build(dataSource, isFirstResource)
        }
    }
}

But transition api in compose does not provide any parameters.