From 5ca20e06cf0d84ffe19a50654010d163871e4dd9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 10 May 2020 16:41:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/ImageLoader.kt | 3 +++ .../main/java/io/legado/app/ui/widget/image/CoverImageView.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/ImageLoader.kt b/app/src/main/java/io/legado/app/help/ImageLoader.kt index 49b315a3f..11f8dff21 100644 --- a/app/src/main/java/io/legado/app/help/ImageLoader.kt +++ b/app/src/main/java/io/legado/app/help/ImageLoader.kt @@ -13,6 +13,9 @@ import java.io.File object ImageLoader { + /** + * 自动判断path类型 + */ fun load(context: Context, path: String?): RequestBuilder { return when { path.isNullOrEmpty() -> Glide.with(context).load(path) diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index 426391be4..e0268da7e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -130,7 +130,7 @@ class CoverImageView : androidx.appcompat.widget.AppCompatImageView { fun load(path: String?, name: String?, author: String?) { setText(name, author) - ImageLoader.load(context, path)//Glide自动识别http://和file:// + ImageLoader.load(context, path)//Glide自动识别http://,content://和file:// .placeholder(R.drawable.image_cover_default) .error(R.drawable.image_cover_default) .listener(object : RequestListener {