pull/78/head
kunfei 5 years ago
parent 791ff1dff9
commit 03c58f35f7
  1. 1
      app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt

@ -53,6 +53,7 @@ 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)
if (it.isEmpty()) return@Observer
viewModel.book?.let { book -> viewModel.book?.let { book ->
durChapterIndex = book.durChapterIndex durChapterIndex = book.durChapterIndex
tv_current_chapter_info.text = it[durChapterIndex()].title tv_current_chapter_info.text = it[durChapterIndex()].title

Loading…
Cancel
Save