Android Glide图像缓存:即使预加载也会启动新的加载

时间:2018-03-01 00:05:18

标签: android caching android-glide

我在Android中使用Glide 3.8.0来预取图像:

            Glide.with(context)
                    .load(imageUrl)
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .preload();

有了这个,我看到显示分辨率的日志[-2147483648x-2147483648]

V/Engine: Started new load in 1.75375ms, key: EngineKey{https://....com/uu/api/res/1.2/15USE5cHzsN75A26JngW_Q--/YXBwaWQ9eXRhY2h5b247Zmk9c3RyaW07aD0zNjA7dz02NDA7/http://....com/c026d208260f1b9d6880604661897d28+com.bumptech.glide.signature.EmptySignature@1341382+[-2147483648x-2147483648]+''+'ImageVideoBitmapDecoder.com.bumptech.glide.load.resource.bitmap'+''+'BitmapEncoder.com.bumptech.glide.load.resource.bitmap'+'GifBitmapWrapperDrawableTranscoder.com.bumptech.glide.load.resource.transcode'+''}

加载实际图像视图时,查找的大小不同[1224x1020]:

V/Engine: Started new load in 0.45197899999999996ms, key: EngineKey{https://....com/uu/api/res/1.2/15USE5cHzsN75A26JngW_Q--/YXBwaWQ9eXRhY2h5b247Zmk9c3RyaW07aD0zNjA7dz02NDA7/http://....com/c026d208260f1b9d6880604661897d28+com.bumptech.glide.signature.EmptySignature@1341382+[1224x1020]+''+'ImageVideoBitmapDecoder.com.bumptech.glide.load.resource.bitmap'+''+'BitmapEncoder.com.bumptech.glide.load.resource.bitmap'+'GifBitmapWrapperDrawableTranscoder.com.bumptech.glide.load.resource.transcode'+''}

如果我不想提前考虑尺寸,我该如何缓存呢?

0 个答案:

没有答案