|
|
@ -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) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|