Simplify search logic using SearchView (#3459)
Refactor the search functionality to use SearchView for better handling of search queries. - Removed redundant code and replaced it with SearchView's onQueryTextChange listener. - Improved readability and maintainability of the search logic.
This commit is contained in:
@@ -188,12 +188,10 @@ class PerAppProxyActivity : BaseActivity() {
|
||||
if (searchItem != null) {
|
||||
val searchView = searchItem.actionView as SearchView
|
||||
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||
return false
|
||||
}
|
||||
override fun onQueryTextSubmit(query: String?): Boolean = false
|
||||
|
||||
override fun onQueryTextChange(newText: String?): Boolean {
|
||||
filterProxyApp(newText?:"")
|
||||
filterProxyApp(newText.orEmpty())
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user