pull/32/head
kunfei 5 years ago
parent 3bb31c8334
commit a317b53ca8
  1. 6
      app/src/main/java/io/legado/app/ui/chapterlist/ChapterListFragment.kt

@ -52,14 +52,14 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme
liveData?.removeObservers(viewLifecycleOwner)
liveData = LivePagedListBuilder(App.db.bookChapterDao().observeByBook(viewModel.bookUrl ?: ""), 30).build()
liveData?.observe(viewLifecycleOwner, Observer { adapter.submitList(it) })
}
private fun initView() {
viewModel.bookDate.value?.let {
loadBookFinish(it)
} ?: viewModel.bookDate.observe(viewLifecycleOwner, Observer {
loadBookFinish(it)
})
}
private fun initView() {
iv_chapter_top.onClick { recycler_view.scrollToPosition(0) }
iv_chapter_bottom.onClick {
if (adapter.itemCount > 0) {

Loading…
Cancel
Save