diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index 3c960093b..6041de8f5 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -27,6 +27,7 @@ import io.legado.app.service.AudioPlayService import io.legado.app.service.help.AudioPlay import io.legado.app.ui.book.changesource.ChangeSourceDialog import io.legado.app.ui.book.chapterlist.ChapterListActivity +import io.legado.app.ui.widget.image.CoverImageView import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_audio_play.* import org.apache.commons.lang3.time.DateFormatUtils @@ -117,8 +118,8 @@ class AudioPlayActivity : private fun upCover(path: String?) { ImageLoader.load(this, path) - .placeholder(R.drawable.image_cover_default) - .error(R.drawable.image_cover_default) + .placeholder(CoverImageView.defaultDrawable) + .error(CoverImageView.defaultDrawable) .into(iv_cover) ImageLoader.load(this, path) .transition(DrawableTransitionOptions.withCrossFade(1500)) @@ -128,7 +129,7 @@ class AudioPlayActivity : } private fun defaultCover(): RequestBuilder { - return ImageLoader.load(this, R.drawable.image_cover_default) + return ImageLoader.load(this, CoverImageView.defaultDrawable) .apply(bitmapTransform(BlurTransformation(this, 25))) } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 09f1e0254..14f190329 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -32,6 +32,7 @@ import io.legado.app.ui.book.info.edit.BookInfoEditActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity +import io.legado.app.ui.widget.image.CoverImageView import io.legado.app.utils.dp import io.legado.app.utils.getViewModel import io.legado.app.utils.gone @@ -141,7 +142,7 @@ class BookInfoActivity : } private fun defaultCover(): RequestBuilder { - return ImageLoader.load(this, R.drawable.image_cover_default) + return ImageLoader.load(this, CoverImageView.defaultDrawable) .apply(bitmapTransform(BlurTransformation(this, 25))) } 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 464911035..f2b4373a4 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 @@ -165,7 +165,7 @@ class CoverImageView : androidx.appcompat.widget.AppCompatImageView { companion object { private var showBookName = false - private lateinit var defaultDrawable: Drawable + lateinit var defaultDrawable: Drawable init { upDefaultCover()