1
0
Fork 0

Fixes #4997: Changed navigation to ShareFragment

Added global navigation action to share fragment in navigation graph
Changed share action to use global navigation to ShareFragment
master
mihai-adrian 2019-08-30 10:45:58 +03:00 committed by Emily Kager
parent 389b85f783
commit fc8fc2b33d
2 changed files with 5 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import kotlinx.coroutines.ObsoleteCoroutinesApi
import kotlinx.coroutines.launch
import mozilla.components.browser.session.Session
import mozilla.components.concept.engine.EngineView
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserFragment
import org.mozilla.fenix.browser.BrowserFragmentDirections
@ -96,8 +97,8 @@ class DefaultBrowserToolbarController(
ToolbarMenu.Item.Share -> {
val currentUrl = currentSession?.url
currentUrl?.apply {
val directions = BrowserFragmentDirections.actionBrowserFragmentToShareFragment(this)
navController.nav(R.id.browserFragment, directions)
val directions = NavGraphDirections.actionGlobalShareFragment(this)
navController.navigate(directions)
}
}
ToolbarMenu.Item.NewTab -> {

View File

@ -513,4 +513,6 @@
<dialog
android:id="@+id/signOutFragment"
android:name="org.mozilla.fenix.settings.SignOutFragment" />
<action android:id="@+id/action_global_shareFragment"
app:destination="@id/shareFragment"/>
</navigation>