|
|
|
@ -49,7 +49,6 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
|
private var menu: Menu? = null |
|
|
|
|
private var precisionSearchMenuItem: MenuItem? = null |
|
|
|
|
private var groups = hashSetOf<String>() |
|
|
|
|
private var queryText: String? = null |
|
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
|
viewModel.callBack = this |
|
|
|
@ -108,9 +107,8 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onQueryTextChange(newText: String?): Boolean { |
|
|
|
|
queryText = newText |
|
|
|
|
if (queryText.isNullOrBlank()) viewModel.stop() |
|
|
|
|
upHistory(queryText) |
|
|
|
|
if (newText.isNullOrBlank()) viewModel.stop() |
|
|
|
|
upHistory(newText) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -182,7 +180,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
|
|
|
|
|
|
private fun openOrCloseHistory(open: Boolean) { |
|
|
|
|
if (open) { |
|
|
|
|
upHistory(queryText) |
|
|
|
|
upHistory(search_view.query.toString()) |
|
|
|
|
ll_history.visibility = VISIBLE |
|
|
|
|
} else { |
|
|
|
|
ll_history.visibility = GONE |
|
|
|
|