pull/32/head
kunfei 5 years ago
parent b81650bf1f
commit b9f4d79527
  1. 10
      app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt

@ -40,7 +40,13 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
viewModel.bookData.observe(this, Observer { showBook(it) })
viewModel.isLoadingData.observe(this, Observer { upLoading(it) })
viewModel.chapterListData.observe(this, Observer { showChapter(it) })
viewModel.loadBook(intent)
viewModel.bookData.value?.let {
showBook(it)
upLoading(false)
viewModel.chapterListData.value?.let { chapters ->
showChapter(chapters)
}
} ?: viewModel.loadBook(intent)
initOnClick()
savedInstanceState?.let {
changeSourceDialog = supportFragmentManager.findFragmentByTag(ChangeSourceDialog.tag) as? ChangeSourceDialog
@ -184,7 +190,7 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
}
override fun changeTo(book: Book) {
viewModel.bookData.postValue(book)
}
override fun skipToChapter(index: Int) {

Loading…
Cancel
Save