|
|
@ -187,11 +187,11 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel |
|
|
|
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { |
|
|
|
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { |
|
|
|
override fun onQueryTextSubmit(query: String?): Boolean { |
|
|
|
override fun onQueryTextSubmit(query: String?): Boolean { |
|
|
|
searchView.clearFocus() |
|
|
|
searchView.clearFocus() |
|
|
|
query?.let { |
|
|
|
query?.trim()?.let { searchKey -> |
|
|
|
isManualStopSearch = false |
|
|
|
isManualStopSearch = false |
|
|
|
viewModel.saveSearchKey(query) |
|
|
|
viewModel.saveSearchKey(searchKey) |
|
|
|
viewModel.searchKey = "" |
|
|
|
viewModel.searchKey = "" |
|
|
|
viewModel.search(it) |
|
|
|
viewModel.search(searchKey) |
|
|
|
} |
|
|
|
} |
|
|
|
visibleInputHelp(false) |
|
|
|
visibleInputHelp(false) |
|
|
|
return true |
|
|
|
return true |
|
|
@ -199,7 +199,7 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel |
|
|
|
|
|
|
|
|
|
|
|
override fun onQueryTextChange(newText: String?): Boolean { |
|
|
|
override fun onQueryTextChange(newText: String?): Boolean { |
|
|
|
if (newText.isNullOrBlank()) viewModel.stop() |
|
|
|
if (newText.isNullOrBlank()) viewModel.stop() |
|
|
|
upHistory(newText) |
|
|
|
upHistory(newText?.trim()) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|