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.durChapterIndex = AudioPlay.durChapterIndex
book.durChapterPos = AudioPlay.durPageIndex
book.durChapterTitle = subtitle
App.db.bookDao().update(book)
}
}

@ -48,9 +48,9 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(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)
}
})

Loading…
Cancel
Save