当前位置:网站首页>Glide advanced level
Glide advanced level
2022-07-05 10:11:00 【asahi_ xin】
cache
- skipMemoryCache(true/false) Whether to skip memory cache .
skipMemoryCache That means Glide Will not put pictures into memory cache . The default is false, So you don't need to call .
Glide.with(this)
.load(" Address ")
.skipMemoryCache(true)
.into(imageView);
When skipping memory cache ,Glide Disk cache will still be used to avoid repeated network requests .
Glide Not only the original image is cached , It also caches full resolution images and other small versions of images . such as , If an image you request is 1000x1000 Pixel , But yours. ImageView yes 500x500 Pixel ,Glide These two sizes will be cached .
If a picture has the same URL, But changes are fast , You may want to disable even disk caching .
- diskCacheStrategy Skip disk cache , Take enumeration as a parameter , The parameters are as follows .
Parameters | Meaning |
---|---|
DiskCacheStrategy.NONE | Don't cache |
DiskCacheStrategy.SOURCE | Just cache the original full resolution image |
DiskCacheStrategy.RESULT | Only the final image is cached |
DiskCacheStrategy.ALL | Cache all versions of images ( Default ) |
Glide.with(this)
.load(" Address ")
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.into(imageView);
Request priority
We often have this need , A screen , To request multiple pictures at the same time , But pictures have priority .Glide There is a treatment in this regard .
- priority Priority of image loading . Method parameters are also enumeration types .
- Priority.LOW
- Priority.NORMAL
- Priority.HIGH
- Priority.IMMEDIATE
Glide.with(this)
.load(" Address ")
.priority(Priority.HIGH)
.into(imageView);
边栏推荐
- Tdengine can read and write through dataX, a data synchronization tool
- Charm of code language
- 天龙八部TLBB系列 - 单体技能群伤
- 高级 OpenCV:BGR 像素强度图
- Tdengine connector goes online Google Data Studio app store
- 天龙八部TLBB系列 - 关于包裹掉落的物品
- Apache DolphinScheduler 入门(一篇就够了)
- Small program startup performance optimization practice
- Personal website construction tutorial | local website environment construction | website production tutorial
- ArcGIS Pro 创建要素
猜你喜欢
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 -下
如何獲取GC(垃圾回收器)的STW(暫停)時間?
Swift tableview style (I) system basic
【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB
Solve liquibase – waiting for changelog lock Cause database deadlock
善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
Windows uses commands to run kotlin
高级 OpenCV:BGR 像素强度图
Analysis on the wallet system architecture of Baidu trading platform
随机推荐
Wechat applet - simple diet recommendation (4)
Zblogphp breadcrumb navigation code
mysql80服务不启动
Analysis on the wallet system architecture of Baidu trading platform
Dedecms website building tutorial
Swift saves an array of class objects with userdefaults and nssecurecoding
字节跳动面试官:一张图片占据的内存大小是如何计算
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
Baidu app's continuous integration practice based on pipeline as code
cent7安装Oracle数据库报错
The comparison of every() and some() in JS uses a power storage plan
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
如何写出高质量的代码?
Node red series (29): use slider and chart nodes to realize double broken line time series diagram
Swift tableview style (I) system basic
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on
ArcGIS Pro 创建要素
Data visualization platform based on template configuration
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图