mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Merge pull request #7014 from Bnyro/master
fix: search action view not properly collapsed when pressing navbar item
This commit is contained in:
commit
e2a35b49e3
@ -254,17 +254,6 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the focus of the search view in the toolbar
|
||||
*/
|
||||
private fun removeSearchFocus() {
|
||||
searchView.setQuery("", false)
|
||||
searchView.clearFocus()
|
||||
searchView.isIconified = true
|
||||
searchItem.collapseActionView()
|
||||
searchView.onActionViewCollapsed()
|
||||
}
|
||||
|
||||
private fun isSearchInProgress(): Boolean {
|
||||
if (!this::navController.isInitialized) return false
|
||||
val id = navController.currentDestination?.id ?: return false
|
||||
@ -560,9 +549,7 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
// Remove focus from search view when navigating to bottom view.
|
||||
// Call only after navigate to destination, so it can be used in
|
||||
// onMenuItemActionCollapse for backstack management
|
||||
removeSearchFocus()
|
||||
searchItem.collapseActionView()
|
||||
|
||||
return item.onNavDestinationSelected(navController)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user