mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix: search action view not properly collapsed when pressing navbar item
This commit is contained in:
parent
95525dd8ce
commit
0db6635998
@ -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 {
|
private fun isSearchInProgress(): Boolean {
|
||||||
if (!this::navController.isInitialized) return false
|
if (!this::navController.isInitialized) return false
|
||||||
val id = navController.currentDestination?.id ?: 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.
|
// Remove focus from search view when navigating to bottom view.
|
||||||
// Call only after navigate to destination, so it can be used in
|
searchItem.collapseActionView()
|
||||||
// onMenuItemActionCollapse for backstack management
|
|
||||||
removeSearchFocus()
|
|
||||||
|
|
||||||
return item.onNavDestinationSelected(navController)
|
return item.onNavDestinationSelected(navController)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user