当前位置:网站首页>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);
边栏推荐
- 面试:List 如何根据对象的属性去重?
- Cross process communication Aidl
- 驱动制造业产业升级新思路的领域知识网络,什么来头?
- Generics, generic defects and application scenarios that 90% of people don't understand
- Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常
- Applet image height adaptation and setting text line height
- @SerializedName注解使用
- 把欧拉的创新带向世界 SUSE 要做那个引路人
- Apache DolphinScheduler 系统架构设计
- 【OpenCV 例程200篇】219. 添加数字水印(盲水印)
猜你喜欢
isEmpty 和 isBlank 的用法区别
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package can be used directly - next
RMS TO EAP通过MQTT简单实现
Tdengine already supports the industrial Intel edge insight package
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
RMS to EAP is simply implemented through mqtt
【OpenCV 例程200篇】219. 添加数字水印(盲水印)
Apache dolphin scheduler system architecture design
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on
宝塔面板MySQL无法启动
随机推荐
卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
CSDN always jumps to other positions when editing articles_ CSDN sends articles without moving the mouse
> Could not create task ‘:app:MyTest.main()‘. > SourceSet with name ‘main‘ not found.问题修复
C#函数返回多个值方法
Openes version query
Hard core, have you ever seen robots play "escape from the secret room"? (code attached)
Cerebral cortex: directed brain connection recognition widespread functional network abnormalities in Parkinson's disease
The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
MySQL数字类型学习笔记
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
Design and Simulation of fuzzy PID control system for liquid level of double tank (matlab/simulink)
面试:List 如何根据对象的属性去重?
H. 265 introduction to coding principles
Uni app running to wechat development tool cannot Preview
On July 2, I invite you to TD Hero online press conference
【小技巧】獲取matlab中cdfplot函數的x軸,y軸的數值
Uncover the practice of Baidu intelligent testing in the field of automatic test execution
Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode
Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常