pull/84/head
kunfei 5 years ago
parent 3c3654f278
commit 3c2e0f53de
  1. 27
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt

@ -112,23 +112,13 @@ class BookInfoActivity :
} }
private fun showBook(book: Book) { private fun showBook(book: Book) {
showCover(book)
tv_name.text = book.name tv_name.text = book.name
tv_author.text = getString(R.string.author_show, book.author) tv_author.text = getString(R.string.author_show, book.author)
tv_origin.text = getString(R.string.origin_show, book.originName) tv_origin.text = getString(R.string.origin_show, book.originName)
tv_lasted.text = getString(R.string.lasted_show, book.latestChapterTitle) tv_lasted.text = getString(R.string.lasted_show, book.latestChapterTitle)
tv_toc.text = getString(R.string.toc_s, book.latestChapterTitle) tv_toc.text = getString(R.string.toc_s, book.latestChapterTitle)
tv_intro.text = book.getDisplayIntro() tv_intro.text = book.getDisplayIntro()
book.getDisplayCover()?.let {
ImageLoader.load(this, it)
.centerCrop()
.into(iv_cover)
ImageLoader.load(this, it)
.transition(DrawableTransitionOptions.withCrossFade(1500))
.thumbnail(defaultCover())
.centerCrop()
.apply(bitmapTransform(BlurTransformation(this, 25)))
.into(bg_book) //模糊、渐变、缩小效果
}
val kinds = book.getKindList() val kinds = book.getKindList()
if (kinds.isEmpty()) { if (kinds.isEmpty()) {
ll_kind.gone() ll_kind.gone()
@ -161,6 +151,20 @@ class BookInfoActivity :
} }
} }
private fun showCover(book: Book) {
book.getDisplayCover()?.let {
ImageLoader.load(this, it)
.centerCrop()
.into(iv_cover)
ImageLoader.load(this, it)
.transition(DrawableTransitionOptions.withCrossFade(1500))
.thumbnail(defaultCover())
.centerCrop()
.apply(bitmapTransform(BlurTransformation(this, 25)))
.into(bg_book) //模糊、渐变、缩小效果
}
}
private fun showChapter(chapterList: List<BookChapter>) { private fun showChapter(chapterList: List<BookChapter>) {
viewModel.bookData.value?.let { viewModel.bookData.value?.let {
if (it.durChapterIndex < chapterList.size) { if (it.durChapterIndex < chapterList.size) {
@ -285,6 +289,7 @@ class BookInfoActivity :
viewModel.bookData.value?.let { viewModel.bookData.value?.let {
it.coverUrl = coverUrl it.coverUrl = coverUrl
viewModel.saveBook() viewModel.saveBook()
showCover(it)
} }
} }

Loading…
Cancel
Save