|
|
|
@ -44,7 +44,8 @@ class BookmarkFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_ |
|
|
|
|
|
|
|
|
|
private fun initData() { |
|
|
|
|
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) }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -53,7 +54,12 @@ class BookmarkFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_ |
|
|
|
|
initData() |
|
|
|
|
} else { |
|
|
|
|
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) }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|