|
|
|
@ -12,6 +12,7 @@ import com.bumptech.glide.request.RequestListener |
|
|
|
|
import com.bumptech.glide.request.target.Target |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.constant.PreferKey |
|
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
|
import io.legado.app.help.ImageLoader |
|
|
|
|
import io.legado.app.utils.getPrefString |
|
|
|
|
import splitties.init.appCtx |
|
|
|
@ -132,6 +133,11 @@ class CoverImageView @JvmOverloads constructor( |
|
|
|
|
|
|
|
|
|
fun load(path: String?, name: String?, author: String?) { |
|
|
|
|
setText(name, author) |
|
|
|
|
if (AppConfig.useDefaultCover) { |
|
|
|
|
ImageLoader.load(context, defaultDrawable) |
|
|
|
|
.centerCrop() |
|
|
|
|
.into(this) |
|
|
|
|
} else { |
|
|
|
|
ImageLoader.load(context, path)//Glide自动识别http://,content://和file:// |
|
|
|
|
.placeholder(defaultDrawable) |
|
|
|
|
.error(defaultDrawable) |
|
|
|
@ -161,6 +167,7 @@ class CoverImageView @JvmOverloads constructor( |
|
|
|
|
.centerCrop() |
|
|
|
|
.into(this) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
|
private var showBookName = false |
|
|
|
|