Skip to content

Commit

Permalink
Simplify search logic using SearchView (#3459)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CodeWithTamim authored Aug 10, 2024
1 parent 818b7cd commit 1652040
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down

0 comments on commit 1652040

Please sign in to comment.