Make search views take up full width

This commit is contained in:
arkon 2020-04-29 09:02:09 -04:00
parent 0eb61f34f6
commit 8efe0502f3
4 changed files with 4 additions and 0 deletions

View File

@ -193,6 +193,7 @@ class SourceController :
// Initialize search option.
val searchItem = menu.findItem(R.id.action_search)
val searchView = searchItem.actionView as SearchView
searchView.maxWidth = Int.MAX_VALUE
// Change hint to show global search.
searchView.queryHint = applicationContext?.getString(R.string.action_global_search_hint)

View File

@ -233,6 +233,7 @@ open class BrowseSourceController(bundle: Bundle) :
// Initialize search menu
val searchItem = menu.findItem(R.id.action_search)
val searchView = searchItem.actionView as SearchView
searchView.maxWidth = Int.MAX_VALUE
val query = presenter.query
if (!query.isBlank()) {

View File

@ -100,6 +100,7 @@ open class GlobalSearchController(
// Initialize search menu
val searchItem = menu.findItem(R.id.action_search)
val searchView = searchItem.actionView as SearchView
searchView.maxWidth = Int.MAX_VALUE
searchItem.setOnActionExpandListener(object : MenuItem.OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {

View File

@ -326,6 +326,7 @@ class LibraryController(
val searchItem = menu.findItem(R.id.action_search)
val searchView = searchItem.actionView as SearchView
searchView.maxWidth = Int.MAX_VALUE
searchView.queryTextChanges()
// Ignore events if this controller isn't at the top