尝试使用滑行缓存图像

问题描述

这是我的滑行设置:

        requestOptions.diskCacheStrategy(diskCacheStrategy.ALL).placeholder(circularProgressDrawable)



Glide.with(this)
                    .load(imagesArray[position].img)
                    .apply(requestOptions)
                    .error(ContextCompat.getDrawable(activity,R.drawable.not_available))
                    .into(images)

根据Glide文档:

实际上,使缓存文件无效的最佳方法是在内容可能发生变化(URL,uri,文件路径等)时更改标识符。

通过这种设置,glide不会在每次加载应用程序时都缓存图像,即使它是相同的url,glide也会从url检索图像,

这是我当前的滑行版本:

implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)