|
|
@ -35,8 +35,7 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme |
|
|
|
private lateinit var mLayoutManager: UpLinearLayoutManager |
|
|
|
private lateinit var mLayoutManager: UpLinearLayoutManager |
|
|
|
private var tocLiveData: LiveData<List<BookChapter>>? = null |
|
|
|
private var tocLiveData: LiveData<List<BookChapter>>? = null |
|
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
|
|
|
|
viewModel.chapterCallBack = this |
|
|
|
viewModel.chapterCallBack = this |
|
|
|
initRecyclerView() |
|
|
|
initRecyclerView() |
|
|
|
initView() |
|
|
|
initView() |
|
|
@ -79,6 +78,10 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun observeLiveBus() { |
|
|
|
|
|
|
|
super.observeLiveBus() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun initDoc() { |
|
|
|
private fun initDoc() { |
|
|
|
tocLiveData?.removeObservers(this@ChapterListFragment) |
|
|
|
tocLiveData?.removeObservers(this@ChapterListFragment) |
|
|
|
tocLiveData = App.db.bookChapterDao().observeByBook(viewModel.bookUrl) |
|
|
|
tocLiveData = App.db.bookChapterDao().observeByBook(viewModel.bookUrl) |
|
|
|