feat: 优化

pull/219/head
kunfei 5 years ago
parent 606324e943
commit 5ca20e06cf
  1. 3
      app/src/main/java/io/legado/app/help/ImageLoader.kt
  2. 2
      app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt

@ -13,6 +13,9 @@ import java.io.File
object ImageLoader {
/**
* 自动判断path类型
*/
fun load(context: Context, path: String?): RequestBuilder<Drawable> {
return when {
path.isNullOrEmpty() -> Glide.with(context).load(path)

@ -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<Drawable> {

Loading…
Cancel
Save