pull/49/head
kunfei 5 years ago
parent 0bddecbdb6
commit 3865e6dc71
  1. 24
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt

@ -93,17 +93,19 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
} }
} }
private fun upCover(path: String) { private fun upCover(path: String?) {
ImageLoader.load(this, path) path?.let {
.placeholder(R.drawable.image_cover_default) ImageLoader.load(this, it)
.error(R.drawable.image_cover_default) .placeholder(R.drawable.image_cover_default)
.centerCrop() .error(R.drawable.image_cover_default)
.into(iv_cover) .centerCrop()
ImageLoader.load(this, path) .into(iv_cover)
.thumbnail(defaultCover()) ImageLoader.load(this, it)
.centerCrop() .thumbnail(defaultCover())
.apply(RequestOptions.bitmapTransform(BlurTransformation(this, 25))) .centerCrop()
.into(iv_bg) .apply(RequestOptions.bitmapTransform(BlurTransformation(this, 25)))
.into(iv_bg)
}
} }
private fun defaultCover(): RequestBuilder<Drawable> { private fun defaultCover(): RequestBuilder<Drawable> {

Loading…
Cancel
Save