From abd30ef58f2f2b810b2c7e4ad7fa54e55b8d1a05 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 26 May 2021 22:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/info/BookInfoActivity.kt | 4 ++++ .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 65fdfff87..de21ed9b5 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -59,6 +59,10 @@ class BookInfoActivity : book.durChapterPos = it.second appDb.bookDao.update(book) } + viewModel.chapterListData.value?.let { chapterList -> + binding.tvToc.text = + getString(R.string.toc_s, chapterList[book.durChapterIndex].title) + } startReadActivity(book) } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index ffe391f68..6fe2feaec 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -68,9 +68,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { if (ReadBook.durChapterIndex != book.durChapterIndex) { ReadBook.durChapterIndex = book.durChapterIndex ReadBook.durChapterPos = book.durChapterPos - ReadBook.prevTextChapter = null - ReadBook.curTextChapter = null - ReadBook.nextTextChapter = null + ReadBook.clearTextChapter() } ReadBook.titleDate.postValue(book.name) ReadBook.upWebBook(book)