pull/61/head^2
kunfei 5 years ago
parent 977b4121c9
commit 4f7a4dc1e7
  1. 1
      app/src/main/java/io/legado/app/service/AudioPlayService.kt
  2. 6
      app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt

@ -356,6 +356,7 @@ class AudioPlayService : BaseService(),
book.durChapterTime = System.currentTimeMillis() book.durChapterTime = System.currentTimeMillis()
book.durChapterIndex = AudioPlay.durChapterIndex book.durChapterIndex = AudioPlay.durChapterIndex
book.durChapterPos = AudioPlay.durPageIndex book.durChapterPos = AudioPlay.durPageIndex
book.durChapterTitle = subtitle
App.db.bookDao().update(book) App.db.bookDao().update(book)
} }
} }

@ -48,9 +48,9 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme
viewModel.bookUrl?.let { bookUrl -> viewModel.bookUrl?.let { bookUrl ->
App.db.bookChapterDao().observeByBook(bookUrl).observe(viewLifecycleOwner, Observer { App.db.bookChapterDao().observeByBook(bookUrl).observe(viewLifecycleOwner, Observer {
adapter.setItems(it) adapter.setItems(it)
viewModel.book?.let { viewModel.book?.let { book ->
durChapterIndex = it.durChapterIndex durChapterIndex = book.durChapterIndex
tv_current_chapter_info.text = it.durChapterTitle tv_current_chapter_info.text = book.durChapterTitle
recycler_view.scrollToPosition(durChapterIndex) recycler_view.scrollToPosition(durChapterIndex)
} }
}) })

Loading…
Cancel
Save