From 3865e6dc71f6c7d5de0e7db2d5e30e25d9c2b9b0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 29 Nov 2019 22:20:27 +0800 Subject: [PATCH] up --- .../legado/app/ui/audio/AudioPlayActivity.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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 8c78bb92c..0b573d5eb 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 @@ -93,17 +93,19 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a } } - private fun upCover(path: String) { - ImageLoader.load(this, path) - .placeholder(R.drawable.image_cover_default) - .error(R.drawable.image_cover_default) - .centerCrop() - .into(iv_cover) - ImageLoader.load(this, path) - .thumbnail(defaultCover()) - .centerCrop() - .apply(RequestOptions.bitmapTransform(BlurTransformation(this, 25))) - .into(iv_bg) + private fun upCover(path: String?) { + path?.let { + ImageLoader.load(this, it) + .placeholder(R.drawable.image_cover_default) + .error(R.drawable.image_cover_default) + .centerCrop() + .into(iv_cover) + ImageLoader.load(this, it) + .thumbnail(defaultCover()) + .centerCrop() + .apply(RequestOptions.bitmapTransform(BlurTransformation(this, 25))) + .into(iv_bg) + } } private fun defaultCover(): RequestBuilder {