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