mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
fix: backstack when opening search fragment (#7010)
This commit is contained in:
parent
7c7e69d369
commit
e42866de7c
@ -356,7 +356,7 @@ class MainActivity : BaseActivity() {
|
|||||||
override fun onMenuItemActionExpand(item: MenuItem): Boolean {
|
override fun onMenuItemActionExpand(item: MenuItem): Boolean {
|
||||||
if (navController.currentDestination?.id != R.id.searchResultFragment) {
|
if (navController.currentDestination?.id != R.id.searchResultFragment) {
|
||||||
searchViewModel.setQuery(null)
|
searchViewModel.setQuery(null)
|
||||||
navController.navigate(R.id.searchFragment)
|
navController.navigate(R.id.openSearch)
|
||||||
}
|
}
|
||||||
item.setShowAsAction(
|
item.setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_ALWAYS or MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
|
MenuItem.SHOW_AS_ACTION_ALWAYS or MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
|
||||||
|
@ -119,4 +119,10 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/showSearchResults"
|
android:id="@+id/showSearchResults"
|
||||||
app:destination="@id/searchResultFragment" />
|
app:destination="@id/searchResultFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/openSearch"
|
||||||
|
app:destination="@id/searchFragment"
|
||||||
|
app:popUpTo="@id/homeFragment"
|
||||||
|
app:popUpToSaveState="true"
|
||||||
|
app:restoreState="false" />
|
||||||
</navigation>
|
</navigation>
|
Loading…
x
Reference in New Issue
Block a user