Google推荐的图片加载库Glide介绍(与Picasso比较)一

来源:互联网 发布:ubuntu 12.04 双系统 编辑:程序博客网 时间:2024/06/04 19:22

在泰国举行的谷歌开发者论坛上,谷歌为我们介绍了一个名叫 Glide 的图片加载库,作者是bumptech。这个库被广泛的运用在google的开源项目中,包括2014年google I/O大会上发布的官方app。

它的成功让我非常感兴趣。我花了一整晚的时间把玩,决定分享一些自己的经验。在开始之前我想说,Glide和Picasso有90%的相似度,准确的说,就是Picasso的克隆版本。但是在细节上还是有不少区别的。

导入库

Picasso和Glide都在jcenter上。在项目中添加依赖非常简单:

Picasso

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >dependencies {de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >compile de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >'com.squareup.picasso:picasso:2.5.1'de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >}de>

Glide

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
4
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >dependencies {de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >compile de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >'com.github.bumptech.glide:glide:3.5.2'de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >compile de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >'com.android.support:support-v4:22.0.0'de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >}de>

Glide需要依赖Support Library v4,别忘了。其实Support Library v4已经是应用程序的标配了,这不是什么问题。

基础

就如我所说的Glide和Picasso非常相似,Glide加载图片的方法和Picasso如出一辙。

Picasso

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >Picasso.de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >withde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >(context)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.load(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"http://inthecheesefactory.com/uploads/source/glidepicasso/cover.jpg"de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.into(ivImg);de>

Glide

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >Glide.de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >withde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >(context)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.load(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"http://inthecheesefactory.com/uploads/source/glidepicasso/cover.jpg"de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.into(ivImg);de>

虽然两者看起来一样,但是Glide更易用,因为Glide的with方法不光接受Context,还接受Activity 和 Fragment,Context会自动的从他们获取。

with

同 时将Activity/Fragment作为with()参数的好处是:图片加载会和Activity/Fragment的生命周期保持一致,比如 Paused状态在暂停加载,在Resumed的时候又自动重新加载。所以我建议传参的时候传递Activity 和 Fragment给Glide,而不是Context。

默认Bitmap格式是RGB_565

下面是加载图片时和Picasso的比较(1920x1080 像素的图片加载到768x432的ImageView中)

firstload

可以看到Glide加载的图片质量要差于Picasso(ps:我看不出来哈),为什么?这是因为Glide默认的Bitmap格式是de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >RGB_565de> ,比de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >ARGB_8888de>格式的内存开销要小一半。下面是Picasso在ARGB8888下与Glide在RGB565下的内存开销图(应用自身占用了8m,因此以8为基准线比较):

ram1_1

如果你对默认的de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >RGB_565de>效果还比较满意,可以不做任何事,但是如果你觉得难以接受,可以创建一个新的de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >GlideModulede>将Bitmap格式转换到de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >ARGB_8888de>:

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
4
5
6
7
8
9
10
11
12
13
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >public class GlideConfiguration implements GlideModule {de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" > de> 
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >@Overridede>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >public void applyOptions(Context context, GlideBuilder builder) {de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >        de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 130, 0) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >// Apply options to the builder here.de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >        de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888);de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >}de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" > de> 
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >@Overridede>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >public void registerComponents(Context context, Glide glide) {de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >        de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 130, 0) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >// register ModelLoaders here.de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >}de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >}de>

de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal; background-color: rgba(0, 0, 0, 0.0392157);" >同时在de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal;" >AndroidManifest.xmlde>中将de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal;" >GlideModulede>定义为de style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; border: 0px; margin: 0px; padding: 0.2em 0px; border-radius: 3px; font-stretch: normal; line-height: normal;" >meta-datade>de>

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" ><meta-data android:name=de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"com.inthecheesefactory.lab.glidepicasso.GlideConfiguration"de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >            de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >android:value=de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"GlideModule"de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >/>de>

quality2

这样看起来就会好很多。

我们再来看看内存开销图,这次貌似Glide花费了两倍于上次的内存,但是Picasso的内存开销仍然远大于Glide。

ram2_1

原因在于Picasso是加载了全尺寸的图片到内存,然后让GPU来实时重绘大小。而Glide加载的大小和ImageView的大小是一致的,因此更小。当然,Picasso也可以指定加载的图片大小的:

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
4
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >Picasso.de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >withde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >thisde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.load(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"http://nuuneoi.com/uploads/source/playstore/cover.jpg"de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.resize(768, 432)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.into(ivImgPicasso);de>

但是问题在于你需要主动计算ImageView的大小,或者说你的ImageView大小是具体的值(而不是wrap_content),你也可以这样:

ortant; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background: none !important;" >ortant; border: 0px !important; margin: 0px !important; padding: 0px !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; min-height: inherit !important; background: none !important;" >ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(175, 175, 175) !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
1
2
3
4
5
ortant; margin: 0px !important; font-size: 1em !important; border-radius: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; right: auto !important; top: auto !important; vertical-align: baseline !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-repeat: initial !important;" >
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >Picasso.de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >withde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: rgb(0, 102, 153) !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >thisde>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.load(de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >"http://nuuneoi.com/uploads/source/playstore/cover.jpg"de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >)de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.fit()de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.centerCrop()de>
de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >    de>de style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin: 0px; padding: 0.2em 0px; border-radius: 3px; line-height: normal; font-stretch: normal; box-sizing: content-box !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline: 0px !important; overflow: visible !important;; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: inherit !important; color: black !important; background-image: none !important; background-attachment: initial !important; background-color: rgba(0, 0, 0, 0.0392157); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background- !important; background-repeat: initial !important;" >.into(ivImgPicasso);de>

现在Picasso的内存开销就和Glide差不多了。

memory3

虽然内存开销差距不到,但是在这个问题上Glide完胜Picasso。因为Glide可以自动计算出任意情况下的ImageView大小。


0 0
原创粉丝点击