From 4f7a4dc1e71f18806da77bd9c1be85832ec71c04 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 16 Dec 2019 17:34:14 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/service/AudioPlayService.kt | 1 + .../io/legado/app/ui/chapterlist/ChapterListFragment.kt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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) } })