Glide

58 阅读1分钟

第一步:引入依赖

 implementation("com.github.bumptech.glide:glide:4.11.0")

第二步:圆形头像

        fun displayCircle(context: Context, iv: ImageView, picResId: Int) {
            val options = RequestOptions.circleCropTransform()
            Glide.with(context).load(picResId).apply(options).into(iv)
        }

第三步:增加混淆文件

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder