Fixes #4997: Changed navigation to ShareFragment
Added global navigation action to share fragment in navigation graph Changed share action to use global navigation to ShareFragmentmaster
parent
389b85f783
commit
fc8fc2b33d
|
@ -16,6 +16,7 @@ import kotlinx.coroutines.ObsoleteCoroutinesApi
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import mozilla.components.browser.session.Session
|
import mozilla.components.browser.session.Session
|
||||||
import mozilla.components.concept.engine.EngineView
|
import mozilla.components.concept.engine.EngineView
|
||||||
|
import org.mozilla.fenix.NavGraphDirections
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.browser.BrowserFragment
|
import org.mozilla.fenix.browser.BrowserFragment
|
||||||
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
||||||
|
@ -96,8 +97,8 @@ class DefaultBrowserToolbarController(
|
||||||
ToolbarMenu.Item.Share -> {
|
ToolbarMenu.Item.Share -> {
|
||||||
val currentUrl = currentSession?.url
|
val currentUrl = currentSession?.url
|
||||||
currentUrl?.apply {
|
currentUrl?.apply {
|
||||||
val directions = BrowserFragmentDirections.actionBrowserFragmentToShareFragment(this)
|
val directions = NavGraphDirections.actionGlobalShareFragment(this)
|
||||||
navController.nav(R.id.browserFragment, directions)
|
navController.navigate(directions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToolbarMenu.Item.NewTab -> {
|
ToolbarMenu.Item.NewTab -> {
|
||||||
|
|
|
@ -513,4 +513,6 @@
|
||||||
<dialog
|
<dialog
|
||||||
android:id="@+id/signOutFragment"
|
android:id="@+id/signOutFragment"
|
||||||
android:name="org.mozilla.fenix.settings.SignOutFragment" />
|
android:name="org.mozilla.fenix.settings.SignOutFragment" />
|
||||||
|
<action android:id="@+id/action_global_shareFragment"
|
||||||
|
app:destination="@id/shareFragment"/>
|
||||||
</navigation>
|
</navigation>
|
||||||
|
|
Loading…
Reference in New Issue