pull/32/head
kunfei 5 years ago
parent 879d41f255
commit 359d11bf60
  1. 3
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt

@ -28,7 +28,6 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_search)
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
initRecyclerView() initRecyclerView()
initSearchView() initSearchView()
initData(0L)
} }
private fun initSearchView() { private fun initSearchView() {
@ -70,7 +69,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_search)
private fun initData(startTime: Long) { private fun initData(startTime: Long) {
searchBookData?.removeObservers(this) searchBookData?.removeObservers(this)
searchBookData = LivePagedListBuilder(App.db.searchBookDao().observeAll(), 30).build() searchBookData = LivePagedListBuilder(App.db.searchBookDao().observeNew(startTime), 30).build()
searchBookData?.observe(this, Observer { adapter.submitList(it) }) searchBookData?.observe(this, Observer { adapter.submitList(it) })
} }

Loading…
Cancel
Save