diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index dce04cd2b..0856ca100 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -356,6 +356,7 @@ class AudioPlayService : BaseService(), book.durChapterTime = System.currentTimeMillis() book.durChapterIndex = AudioPlay.durChapterIndex book.durChapterPos = AudioPlay.durPageIndex + book.durChapterTitle = subtitle App.db.bookDao().update(book) } } diff --git a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt index 18449147e..8a1990b88 100644 --- a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt +++ b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt @@ -48,9 +48,9 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme viewModel.bookUrl?.let { bookUrl -> App.db.bookChapterDao().observeByBook(bookUrl).observe(viewLifecycleOwner, Observer { adapter.setItems(it) - viewModel.book?.let { - durChapterIndex = it.durChapterIndex - tv_current_chapter_info.text = it.durChapterTitle + viewModel.book?.let { book -> + durChapterIndex = book.durChapterIndex + tv_current_chapter_info.text = book.durChapterTitle recycler_view.scrollToPosition(durChapterIndex) } })