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:
Tamim Hossain
2024-08-10 17:51:45 +06:00
committed by GitHub
parent 818b7cdff4
commit 1652040c1c

View File

@@ -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
}
})