From b9f4d7952741babaab1196a3aa3d73fb9a93d8dc Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 19 Aug 2019 14:35:09 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/bookinfo/BookInfoActivity.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt index d0d673d9f..259b0eba3 100644 --- a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt @@ -40,7 +40,13 @@ class BookInfoActivity : VMBaseActivity(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(R.layout.activity_boo } override fun changeTo(book: Book) { - + viewModel.bookData.postValue(book) } override fun skipToChapter(index: Int) {