|
|
@ -44,7 +44,8 @@ class BookmarkFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_ |
|
|
|
|
|
|
|
|
|
|
|
private fun initData() { |
|
|
|
private fun initData() { |
|
|
|
bookmarkLiveData?.removeObservers(viewLifecycleOwner) |
|
|
|
bookmarkLiveData?.removeObservers(viewLifecycleOwner) |
|
|
|
bookmarkLiveData = LivePagedListBuilder(App.db.bookmarkDao().observeByBook(viewModel.bookUrl ?: ""), 20).build() |
|
|
|
bookmarkLiveData = |
|
|
|
|
|
|
|
LivePagedListBuilder(App.db.bookmarkDao().observeByBook(viewModel.bookUrl), 20).build() |
|
|
|
bookmarkLiveData?.observe(viewLifecycleOwner, Observer { adapter.submitList(it) }) |
|
|
|
bookmarkLiveData?.observe(viewLifecycleOwner, Observer { adapter.submitList(it) }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -53,7 +54,12 @@ class BookmarkFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_ |
|
|
|
initData() |
|
|
|
initData() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
bookmarkLiveData?.removeObservers(viewLifecycleOwner) |
|
|
|
bookmarkLiveData?.removeObservers(viewLifecycleOwner) |
|
|
|
bookmarkLiveData = LivePagedListBuilder(App.db.bookmarkDao().liveDataSearch(viewModel.bookUrl ?: "", newText), 20).build() |
|
|
|
bookmarkLiveData = LivePagedListBuilder( |
|
|
|
|
|
|
|
App.db.bookmarkDao().liveDataSearch( |
|
|
|
|
|
|
|
viewModel.bookUrl, |
|
|
|
|
|
|
|
newText |
|
|
|
|
|
|
|
), 20 |
|
|
|
|
|
|
|
).build() |
|
|
|
bookmarkLiveData?.observe(viewLifecycleOwner, Observer { adapter.submitList(it) }) |
|
|
|
bookmarkLiveData?.observe(viewLifecycleOwner, Observer { adapter.submitList(it) }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|