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)