pull/36/head
kunfei 5 years ago
parent 9a4ef149a6
commit e84579e359
  1. 13
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt

@ -120,10 +120,17 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se
tv_book_show.gone() tv_book_show.gone()
rv_bookshelf_search.gone() rv_bookshelf_search.gone()
} else { } else {
tv_book_show.visible()
rv_bookshelf_search.visible()
bookData = App.db.bookDao().liveDataSearch(key) bookData = App.db.bookDao().liveDataSearch(key)
bookData?.observe(this, Observer { bookAdapter.setItems(it) }) bookData?.observe(this, Observer {
if (it.isEmpty()) {
tv_book_show.gone()
rv_bookshelf_search.gone()
} else {
tv_book_show.visible()
rv_bookshelf_search.visible()
}
bookAdapter.setItems(it)
})
} }
historyData?.removeObservers(this) historyData?.removeObservers(this)
historyData = historyData =

Loading…
Cancel
Save