1
0
Fork 0

Cleans up nav_graph.xml (#9829)

* For #9751 - Cleans up homeFragment directions

* For #9751 - Uses global actions for fragments not owned by homeFragment

* For #9751 - Cleans up SearchFragment directions

* For #9751 - Removes settings action from DeleteBrowsingDataFragment

* For #9751 - Removes browser action from SettingsFragment

* For #9751 - Adds ManagePhoneFeature global action

* For #9751 - Clean up unused deletebrowsingfragment actions

* For #9751 - Cleans Up HistoryFragment actions

* For #9751 - Removes Home -> Search action

* For #9751 - Removes the Bookmark -> Browser action

* For #9751 - Cleans up bookmark fragment actions

* For #9751 - Cleans up actions from ShareController

* For #9751 - Removes defaultBrowserFragment to browserFragment action

* For #9751 - Removes about -> browser action

* For #9751 - Adds global action to TrackingProtectionFragment

* For #9751 - Removes exception -> browser action

* For #9751 - Removes login -> browser action

* For #9751 - Fixes LoginFragment directions

* For #9751 - Removes ExternalAppBrowser directions

* for #9751 - Cleans up actions

* For #9751 - Fixes unit tests

* For #9751 - Addresses nits in PR
master
Jeff Boek 2020-04-13 21:43:45 -07:00 committed by GitHub
parent eace991859
commit 4cbb9aebaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 97 additions and 271 deletions

View File

@ -13,7 +13,7 @@ import androidx.navigation.NavDirections
* @property destinationId fragment ID of the fragment being navigated to
*/
enum class GlobalDirections(val navDirections: NavDirections, val destinationId: Int) {
Home(NavGraphDirections.actionGlobalHomeFragment(), R.id.homeFragment),
Home(NavGraphDirections.actionGlobalHome(), R.id.homeFragment),
Settings(
NavGraphDirections.actionGlobalSettingsFragment(),
R.id.settingsFragment

View File

@ -328,31 +328,23 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
BrowserDirection.FromHome ->
HomeFragmentDirections.actionHomeFragmentToBrowserFragment(customTabSessionId, true)
BrowserDirection.FromSearch ->
SearchFragmentDirections.actionSearchFragmentToBrowserFragment(customTabSessionId)
SearchFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromSettings ->
SettingsFragmentDirections.actionSettingsFragmentToBrowserFragment(customTabSessionId)
SettingsFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromBookmarks ->
BookmarkFragmentDirections.actionBookmarkFragmentToBrowserFragment(customTabSessionId)
BookmarkFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromHistory ->
HistoryFragmentDirections.actionHistoryFragmentToBrowserFragment(customTabSessionId)
HistoryFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromExceptions ->
ExceptionsFragmentDirections.actionExceptionsFragmentToBrowserFragment(
customTabSessionId
)
ExceptionsFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromAbout ->
AboutFragmentDirections.actionAboutFragmentToBrowserFragment(customTabSessionId)
AboutFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromTrackingProtection ->
TrackingProtectionFragmentDirections.actionTrackingProtectionFragmentToBrowserFragment(
customTabSessionId
)
TrackingProtectionFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromDefaultBrowserSettingsFragment ->
DefaultBrowserSettingsFragmentDirections.actionDefaultBrowserSettingsFragmentToBrowserFragment(
customTabSessionId
)
DefaultBrowserSettingsFragmentDirections.actionGlobalBrowser(customTabSessionId)
BrowserDirection.FromSavedLoginsFragment ->
SavedLoginsFragmentDirections.actionSavedLoginsFragmentToBrowserFragment(
customTabSessionId
)
SavedLoginsFragmentDirections.actionGlobalBrowser(customTabSessionId)
}
private fun load(

View File

@ -766,7 +766,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
withContext(Main) {
nav(
R.id.browserFragment,
BrowserFragmentDirections.actionBrowserFragmentToBookmarkEditFragment(existing.guid)
BrowserFragmentDirections.actionGlobalBookmarkEditFragment(existing.guid)
)
}
} else {
@ -791,9 +791,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
.setAction(getString(R.string.edit_bookmark_snackbar_action)) {
nav(
R.id.browserFragment,
BrowserFragmentDirections.actionBrowserFragmentToBookmarkEditFragment(
guid
)
BrowserFragmentDirections.actionGlobalBookmarkEditFragment(guid)
)
}
.show()

View File

@ -221,8 +221,7 @@ class DefaultBrowserToolbarController(
ToolbarMenu.Item.AddonsManager -> {
navController.nav(
R.id.browserFragment,
BrowserFragmentDirections
.actionBrowserFragmentToAddonsManagementFragment()
BrowserFragmentDirections.actionGlobalAddonsManagementFragment()
)
}
ToolbarMenu.Item.SaveToCollection -> {
@ -231,7 +230,7 @@ class DefaultBrowserToolbarController(
currentSession?.let { currentSession ->
val directions =
BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment(
BrowserFragmentDirections.actionGlobalCollectionCreationFragment(
previousFragmentId = R.id.browserFragment,
tabIds = arrayOf(currentSession.id),
selectedTabIds = arrayOf(currentSession.id),
@ -316,11 +315,9 @@ class DefaultBrowserToolbarController(
// before we transition the fragment. This makes the animation feel smoother
delay(ANIMATION_DELAY)
if (!navController.popBackStack(R.id.homeFragment, false)) {
val directions = BrowserFragmentDirections.actionBrowserFragmentToHomeFragment()
navController.nav(
R.id.browserFragment,
directions,
null
BrowserFragmentDirections.actionGlobalHome()
)
}
}

View File

@ -55,9 +55,10 @@ class CrashReporterController(
components.useCases.tabsUseCases.removeTab(session)
components.useCases.sessionUseCases.crashRecovery.invoke()
navController.nav(
R.id.crashReporterFragment,
CrashReporterFragmentDirections.actionCrashReporterFragmentToHomeFragment()
CrashReporterFragmentDirections.actionGlobalHome()
)
return job

View File

@ -172,7 +172,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
override fun navToQuickSettingsSheet(session: Session, sitePermissions: SitePermissions?) {
val directions = ExternalAppBrowserFragmentDirections
.actionExternalAppBrowserFragmentToQuickSettingsSheetDialogFragment(
.actionGlobalQuickSettingsSheetDialogFragment(
sessionId = session.id,
url = session.url,
title = session.title,
@ -193,7 +193,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
val isEnabled = session.trackerBlockingEnabled && !contains
val directions =
ExternalAppBrowserFragmentDirections
.actionExternalAppBrowserFragmentToTrackingProtectionPanelDialogFragment(
.actionGlobalTrackingProtectionPanelDialogFragment(
sessionId = session.id,
url = session.url,
trackingProtectionEnabled = isEnabled,

View File

@ -582,7 +582,7 @@ class HomeFragment : Fragment() {
}
private fun navigateToSearch() {
val directions = HomeFragmentDirections.actionHomeFragmentToSearchFragment(
val directions = HomeFragmentDirections.actionGlobalSearch(
sessionId = null
)
@ -590,7 +590,7 @@ class HomeFragment : Fragment() {
}
private fun openSettingsScreen() {
val directions = HomeFragmentDirections.actionHomeFragmentToPrivateBrowsingFragment()
val directions = HomeFragmentDirections.actionGlobalPrivateBrowsingFragment()
nav(R.id.homeFragment, directions)
}
@ -612,7 +612,7 @@ class HomeFragment : Fragment() {
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToSettingsFragment()
HomeFragmentDirections.actionGlobalSettingsFragment()
)
}
HomeMenu.Item.Bookmarks -> {
@ -620,7 +620,7 @@ class HomeFragment : Fragment() {
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToBookmarksFragment(BookmarkRoot.Mobile.id)
HomeFragmentDirections.actionGlobalBookmarkFragment(BookmarkRoot.Mobile.id)
)
}
HomeMenu.Item.History -> {
@ -628,7 +628,7 @@ class HomeFragment : Fragment() {
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToHistoryFragment()
HomeFragmentDirections.actionGlobalHistoryFragment()
)
}
HomeMenu.Item.Help -> {
@ -673,7 +673,7 @@ class HomeFragment : Fragment() {
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToAccountProblemFragment()
HomeFragmentDirections.actionGlobalAccountProblemFragment()
)
}
}

View File

@ -408,7 +408,7 @@ class DefaultSessionControlController(
}
private fun showShareFragment(data: List<ShareData>) {
val directions = HomeFragmentDirections.actionHomeFragmentToShareFragment(
val directions = HomeFragmentDirections.actionGlobalShareFragment(
data = data.toTypedArray()
)
navController.nav(R.id.homeFragment, directions)

View File

@ -17,7 +17,7 @@ import org.mozilla.fenix.home.HomeFragmentDirections
class OnboardingManualSignInViewHolder(private val view: View) : RecyclerView.ViewHolder(view) {
init {
view.turn_on_sync_button.setOnClickListener {
val directions = HomeFragmentDirections.actionHomeFragmentToTurnOnSyncFragment()
val directions = HomeFragmentDirections.actionGlobalTurnOnSync()
Navigation.findNavController(view).navigate(directions)
}
}

View File

@ -85,7 +85,7 @@ class DefaultBookmarkController(
override fun handleBookmarkSharing(item: BookmarkNode) {
navigate(
BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment(
BookmarkFragmentDirections.actionGlobalShareFragment(
data = arrayOf(ShareData(url = item.url, title = item.title))
)
)

View File

@ -186,14 +186,14 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
R.id.open_bookmarks_in_new_tabs_multi_select -> {
openItemsInNewTab { node -> node.url }
navigate(BookmarkFragmentDirections.actionBookmarkFragmentToHomeFragment())
navigate(BookmarkFragmentDirections.actionGlobalHome())
metrics?.track(Event.OpenedBookmarksInNewTabs)
true
}
R.id.open_bookmarks_in_private_tabs_multi_select -> {
openItemsInNewTab(private = true) { node -> node.url }
navigate(BookmarkFragmentDirections.actionBookmarkFragmentToHomeFragment())
navigate(BookmarkFragmentDirections.actionGlobalHome())
metrics?.track(Event.OpenedBookmarksInPrivateTabs)
true
}
@ -202,7 +202,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
ShareData(url = it.url, title = it.title)
}
navigate(
BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment(
BookmarkFragmentDirections.actionGlobalShareFragment(
data = shareTabs.toTypedArray()
)
)
@ -218,7 +218,10 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
private fun navigate(directions: NavDirections) {
invokePendingDeletion()
nav(R.id.bookmarkFragment, directions)
findNavController().nav(
R.id.bookmarkFragment,
directions
)
}
override fun onBackPressed(): Boolean {

View File

@ -82,7 +82,7 @@ class DefaultHistoryController(
override fun handleShare(item: HistoryItem) {
navController.navigate(
HistoryFragmentDirections.actionHistoryFragmentToShareFragment(
HistoryFragmentDirections.actionGlobalShareFragment(
data = arrayOf(ShareData(url = item.url, title = item.title))
)
)

View File

@ -170,7 +170,7 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), UserInteractionHandl
nav(
R.id.historyFragment,
HistoryFragmentDirections.actionHistoryFragmentToHomeFragment()
HistoryFragmentDirections.actionGlobalHome()
)
true
}
@ -186,7 +186,7 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), UserInteractionHandl
}
nav(
R.id.historyFragment,
HistoryFragmentDirections.actionHistoryFragmentToHomeFragment()
HistoryFragmentDirections.actionGlobalHome()
)
true
}
@ -245,7 +245,7 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), UserInteractionHandl
private fun share(data: List<ShareData>) {
requireComponents.analytics.metrics.track(Event.HistoryItemShared)
val directions = HistoryFragmentDirections.actionHistoryFragmentToShareFragment(
val directions = HistoryFragmentDirections.actionGlobalShareFragment(
data = data.toTypedArray()
)
nav(R.id.historyFragment, directions)

View File

@ -160,7 +160,7 @@ class DefaultSearchController(
}
override fun handleClickSearchEngineSettings() {
val directions = SearchFragmentDirections.actionSearchFragmentToSearchEngineFragment()
val directions = SearchFragmentDirections.actionGlobalSearchEngineFragment()
navController.navigateSafe(R.id.searchFragment, directions)
}

View File

@ -271,12 +271,12 @@ class LoginsFragment : PreferenceFragmentCompat(), AccountObserver {
private fun navigateToAccountSettingsFragment() {
val directions =
LoginsFragmentDirections.actionLoginsFragmentToAccountSettingsFragment()
LoginsFragmentDirections.actionGlobalAccountSettingsFragment()
findNavController().navigate(directions)
}
private fun navigateToAccountProblemFragment() {
val directions = LoginsFragmentDirections.actionLoginsFragmentToAccountProblemFragment()
val directions = LoginsFragmentDirections.actionGlobalAccountProblemFragment()
findNavController().navigate(directions)
}

View File

@ -147,7 +147,13 @@ class DeleteBrowsingDataFragment : Fragment(R.layout.fragment_delete_browsing_da
if (popAfter) viewLifecycleOwner.lifecycleScope.launch(
Dispatchers.Main
) {
returnToDeletionOrigin()
findNavController().apply {
// If the user deletes all open tabs we need to make sure we remove
// the BrowserFragment from the backstack.
popBackStack(R.id.homeFragment, false)
navigate(DeleteBrowsingDataFragmentDirections.actionGlobalSettingsFragment())
}
}
}
@ -214,11 +220,6 @@ class DeleteBrowsingDataFragment : Fragment(R.layout.fragment_delete_browsing_da
)
}
private fun returnToDeletionOrigin() {
val directions = DeleteBrowsingDataFragmentDirections.actionDeleteBrowsingDataFragmentToSettingsFragment()
findNavController().navigate(directions)
}
companion object {
private const val ENABLED_ALPHA = 1f
private const val DISABLED_ALPHA = 0.6f

View File

@ -208,7 +208,7 @@ class DefaultQuickSettingsController(
*/
private fun navigateToManagePhoneFeature(phoneFeature: PhoneFeature) {
val directions = QuickSettingsSheetDialogFragmentDirections
.actionQuickSettingsSheetDialogFragmentToSitePermissionsManagePhoneFeature(phoneFeature.id)
.actionGlobalSitePermissionsManagePhoneFeature(phoneFeature.id)
navController.navigate(directions)
}
}

View File

@ -73,7 +73,7 @@ class DefaultShareController(
) : ShareController {
override fun handleReauth() {
val directions = ShareFragmentDirections.actionShareFragmentToAccountProblemFragment()
val directions = ShareFragmentDirections.actionGlobalAccountProblemFragment()
navController.nav(R.id.shareFragment, directions)
dismiss(ShareController.Result.DISMISSED)
}
@ -123,7 +123,7 @@ class DefaultShareController(
override fun handleSignIn() {
context.metrics.track(Event.SignInToSendTab)
val directions =
ShareFragmentDirections.actionShareFragmentToTurnOnSyncFragment(padSnackbar = true)
ShareFragmentDirections.actionGlobalTurnOnSync(padSnackbar = true)
navController.nav(R.id.shareFragment, directions)
dismiss(ShareController.Result.DISMISSED)
}

View File

@ -143,8 +143,7 @@ class TrackingProtectionPanelDialogFragment : AppCompatDialogFragment(), UserInt
requireContext().metrics.track(Event.TrackingProtectionSettingsPanel)
nav(
R.id.trackingProtectionPanelDialogFragment,
TrackingProtectionPanelDialogFragmentDirections
.actionTrackingProtectionPanelDialogFragmentToTrackingProtectionFragment()
TrackingProtectionPanelDialogFragmentDirections.actionGlobalTrackingProtectionFragment()
)
}

View File

@ -5,11 +5,16 @@
android:id="@+id/nav_graph"
app:startDestination="@id/homeFragment">
<action
android:id="@+id/action_global_home"
app:destination="@id/nav_graph"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_global_browser"
app:destination="@id/browserFragment"
app:popUpTo="@id/nav_graph"
app:popUpToInclusive="true" />
app:popUpToInclusive="false" />
<action
android:id="@+id/action_global_external_app_browser"
@ -23,102 +28,51 @@
app:popUpTo="@id/nav_graph"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_global_crash_reporter"
app:destination="@id/crashReporterFragment" />
<action
android:id="@+id/action_global_turn_on_sync"
app:destination="@id/turnOnSyncFragment" />
<action
android:id="@+id/action_global_settingsFragment"
app:destination="@id/settingsFragment" />
<action
android:id="@+id/action_global_settings_addonsManagementFragment"
app:destination="@id/addonsManagementFragment" />
<action
android:id="@+id/action_global_searchEngineFragment"
app:destination="@id/searchEngineFragment" />
<action
android:id="@+id/action_global_accessibilityFragment"
app:destination="@id/accessibilityFragment" />
<action
android:id="@+id/action_global_deleteBrowsingDataFragment"
app:destination="@id/deleteBrowsingDataFragment" />
<action
android:id="@+id/action_global_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_global_webExtensionActionPopupFragment"
app:destination="@id/webExtensionActionPopupFragment" />
<action android:id="@+id/action_global_shareFragment" app:destination="@id/shareFragment" />
<action android:id="@+id/action_global_crash_reporter" app:destination="@id/crashReporterFragment" />
<action android:id="@+id/action_global_turn_on_sync" app:destination="@id/turnOnSyncFragment" />
<action android:id="@+id/action_global_settings_addonsManagementFragment" app:destination="@id/addonsManagementFragment" />
<action android:id="@+id/action_global_searchEngineFragment" app:destination="@id/searchEngineFragment" />
<action android:id="@+id/action_global_accessibilityFragment" app:destination="@id/accessibilityFragment" />
<action android:id="@+id/action_global_deleteBrowsingDataFragment" app:destination="@id/deleteBrowsingDataFragment" />
<action android:id="@+id/action_global_webExtensionActionPopupFragment" app:destination="@id/webExtensionActionPopupFragment" />
<action android:id="@+id/action_global_settingsFragment" app:destination="@id/settingsFragment" />
<action android:id="@+id/action_global_privateBrowsingFragment" app:destination="@id/privateBrowsingFragment"/>
<action android:id="@+id/action_global_bookmarkFragment" app:destination="@id/bookmarkFragment"/>
<action android:id="@+id/action_global_historyFragment" app:destination="@id/historyFragment"/>
<action android:id="@+id/action_global_accountProblemFragment" app:destination="@id/accountProblemFragment"/>
<action android:id="@+id/action_global_SitePermissionsManagePhoneFeature" app:destination="@id/SitePermissionsManagePhoneFeature" />
<action android:id="@+id/action_global_collectionCreationFragment" app:destination="@id/collectionCreationFragment" />
<action android:id="@+id/action_global_bookmarkEditFragment" app:destination="@id/bookmarkEditFragment" />
<action android:id="@+id/action_global_addonsManagementFragment" app:destination="@id/addonsManagementFragment" />
<action android:id="@+id/action_global_trackingProtectionFragment" app:destination="@id/trackingProtectionFragment" />
<action android:id="@+id/action_global_exceptionsFragment" app:destination="@id/exceptionsFragment" />
<action android:id="@+id/action_global_accountSettingsFragment" app:destination="@id/accountSettingsFragment" />
<action android:id="@+id/action_global_trackingProtectionPanelDialogFragment" app:destination="@id/trackingProtectionPanelDialogFragment" />
<action android:id="@+id/action_global_quickSettingsSheetDialogFragment" app:destination="@id/quickSettingsSheetDialogFragment"/>
<fragment
android:id="@+id/homeFragment"
android:name="org.mozilla.fenix.home.HomeFragment"
tools:layout="@layout/fragment_home">
<action
android:id="@+id/action_homeFragment_to_turnOnSyncFragment"
app:destination="@+id/turnOnSyncFragment" />
<action
android:id="@+id/action_homeFragment_to_accountProblemFragment"
app:destination="@id/accountProblemFragment" />
<action
android:id="@+id/action_homeFragment_to_searchFragment"
app:destination="@id/searchFragment"
app:enterAnim="@anim/fade_in_up"
app:popExitAnim="@anim/fade_out_down" />
<action
android:id="@+id/action_homeFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:exitAnim="@anim/zoom_in_fade"
app:popEnterAnim="@anim/zoom_out_fade" />
<action
android:id="@+id/action_homeFragment_to_libraryFragment"
app:destination="@id/libraryFragment" />
<action
android:id="@+id/action_homeFragment_to_bookmarksFragment"
app:destination="@id/bookmarkFragment" />
<action
android:id="@+id/action_homeFragment_to_historyFragment"
app:destination="@id/historyFragment" />
<action
android:id="@+id/action_homeFragment_to_settingsFragment"
app:destination="@id/settingsFragment" />
<action
android:id="@+id/action_homeFragment_to_createCollectionFragment"
app:destination="@id/collectionCreationFragment" />
<action
android:id="@+id/action_homeFragment_to_shareFragment"
app:destination="@id/shareFragment" />
<action
android:id="@+id/action_homeFragment_to_privateBrowsingFragment"
app:destination="@id/privateBrowsingFragment" />
</fragment>
<fragment
android:id="@+id/searchFragment"
android:name="org.mozilla.fenix.search.SearchFragment"
tools:layout="@layout/fragment_search">
<action
android:id="@+id/action_searchFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpTo="@id/searchFragment"
app:popUpToInclusive="true" />
<argument
android:name="session_id"
app:argType="string"
app:nullable="true" />
<action
android:id="@+id/action_searchFragment_to_searchEngineFragment"
app:destination="@id/searchEngineFragment"
app:popUpTo="@+id/searchFragment" />
<argument
android:name="pastedText"
android:defaultValue="@null"
@ -180,9 +134,6 @@
android:name="org.mozilla.fenix.browser.BrowserFragment"
app:exitAnim="@anim/fade_out"
tools:layout="@layout/fragment_browser">
<action
android:id="@+id/action_browserFragment_to_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_browserFragment_to_searchFragment"
app:enterAnim="@anim/fade_in_up"
@ -202,30 +153,18 @@
<action
android:id="@+id/action_browserFragment_to_libraryFragment"
app:destination="@id/libraryFragment" />
<action
android:id="@+id/action_browserFragment_to_bookmarkEditFragment"
app:destination="@id/bookmarkEditFragment" />
<action
android:id="@+id/action_browserFragment_to_createCollectionFragment"
app:destination="@id/collectionCreationFragment" />
<action
android:id="@+id/action_browserFragment_to_createShortcutFragment"
app:destination="@id/createShortcutFragment" />
<action
android:id="@+id/action_browserFragment_to_firstTimePwaFragment"
app:destination="@id/firstTimePwaFragment" />
<action
android:id="@+id/action_browserFragment_to_shareFragment"
app:destination="@id/shareFragment" />
<action
android:id="@+id/action_browserFragment_to_quickSettingsSheetDialogFragment"
app:destination="@id/quickSettingsSheetDialogFragment" />
<action
android:id="@+id/action_browserFragment_to_trackingProtectionPanelDialogFragment"
app:destination="@id/trackingProtectionPanelDialogFragment" />
<action
android:id="@+id/action_browserFragment_to_addonsManagementFragment"
app:destination="@id/addonsManagementFragment" />
</fragment>
<fragment
@ -240,15 +179,6 @@
android:name="webAppManifest"
app:argType="string"
app:nullable="true" />
<action
android:id="@+id/action_externalAppBrowserFragment_to_shareFragment"
app:destination="@id/shareFragment" />
<action
android:id="@+id/action_externalAppBrowserFragment_to_quickSettingsSheetDialogFragment"
app:destination="@id/quickSettingsSheetDialogFragment" />
<action
android:id="@+id/action_externalAppBrowserFragment_to_trackingProtectionPanelDialogFragment"
app:destination="@id/trackingProtectionPanelDialogFragment" />
</fragment>
<fragment
@ -268,19 +198,7 @@
android:id="@+id/historyFragment"
android:name="org.mozilla.fenix.library.history.HistoryFragment"
android:label="@string/library_history"
tools:layout="@layout/fragment_history">
<action
android:id="@+id/action_historyFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpToInclusive="true"
/>
<action
android:id="@+id/action_historyFragment_to_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_historyFragment_to_shareFragment"
app:destination="@id/shareFragment" />
</fragment>
tools:layout="@layout/fragment_history" />
<fragment
android:id="@+id/bookmarkFragment"
@ -289,22 +207,12 @@
<argument
android:name="currentRoot"
app:argType="string" />
<action
android:id="@+id/action_bookmarkFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpToInclusive="true"/>
<action
android:id="@+id/action_bookmarkFragment_self"
app:destination="@id/bookmarkFragment" />
<action
android:id="@+id/action_bookmarkFragment_to_bookmarkEditFragment"
app:destination="@id/bookmarkEditFragment" />
<action
android:id="@+id/action_bookmarkFragment_to_homeFragment"
app:destination="@id/homeFragment" />
<action
android:id="@+id/action_bookmarkFragment_to_shareFragment"
app:destination="@id/shareFragment" />
<action
android:id="@+id/action_bookmarkFragment_to_bookmarkAddFolderFragment"
app:destination="@id/bookmarkAddFolderFragment" />
@ -342,9 +250,6 @@
android:name="visitedAddBookmark"
android:defaultValue="false"
app:argType="boolean" />
<action
android:id="@+id/action_bookmarkSelectFolderFragment_to_browserFragment"
app:destination="@id/browserFragment" />
</fragment>
<fragment
@ -367,20 +272,6 @@
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right"
app:destination="@id/savedLoginsFragment" />
<action
android:id="@+id/action_loginsFragment_to_accountSettingsFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right"
app:destination="@id/accountSettingsFragment" />
<action
android:id="@+id/action_loginsFragment_to_accountProblemFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right"
app:destination="@id/accountProblemFragment" />
<action
android:id="@+id/action_loginsFragment_to_turnOnSyncFragment"
app:enterAnim="@anim/slide_in_right"
@ -401,10 +292,6 @@
android:id="@+id/settingsFragment"
android:name="org.mozilla.fenix.settings.SettingsFragment"
android:label="@string/settings_title">
<action
android:id="@+id/action_settingsFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpTo="@+id/settingsFragment" />
<action
android:id="@+id/action_settingsFragment_to_dataChoicesFragment"
app:enterAnim="@anim/slide_in_right"
@ -596,18 +483,10 @@
<fragment
android:id="@+id/aboutFragment"
android:name="org.mozilla.fenix.settings.about.AboutFragment">
<action
android:id="@+id/action_aboutFragment_to_browserFragment"
app:destination="@id/browserFragment" />
</fragment>
android:name="org.mozilla.fenix.settings.about.AboutFragment"/>
<fragment
android:id="@+id/crashReporterFragment"
android:name="org.mozilla.fenix.crashes.CrashReporterFragment">
<action
android:id="@+id/action_crashReporterFragment_to_homeFragment"
app:destination="@id/homeFragment"
app:popUpTo="@id/nav_graph" />
<argument
android:name="crashIntent"
app:argType="android.content.Intent" />
@ -637,29 +516,15 @@
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right"
app:destination="@id/trackingProtectionBlockingFragment" />
<action
android:id="@+id/action_trackingProtectionFragment_to_browserFragment"
app:destination="@id/browserFragment" />
</fragment>
<fragment
android:id="@+id/deleteBrowsingDataFragment"
android:name="org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataFragment"
android:label="@string/preferences_delete_browsing_data" >
<action
android:id="@+id/action_deleteBrowsingDataFragment_to_settingsFragment"
app:destination="@id/settingsFragment"
app:popUpTo="@id/homeFragment" />
</fragment>
android:label="@string/preferences_delete_browsing_data" />
<fragment
android:id="@+id/exceptionsFragment"
android:name="org.mozilla.fenix.exceptions.ExceptionsFragment"
android:label="@string/preference_exceptions">
<action
android:id="@+id/action_exceptionsFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpTo="@id/settingsFragment"
app:popUpToInclusive="true" />
</fragment>
android:label="@string/preference_exceptions"/>
<dialog
android:id="@+id/collectionCreationFragment"
android:name="org.mozilla.fenix.collections.CollectionCreationFragment"
@ -710,14 +575,6 @@
android:name="showPage"
android:defaultValue="false"
app:argType="boolean" />
<action
android:id="@+id/action_shareFragment_to_turnOnSyncFragment"
app:destination="@+id/turnOnSyncFragment"
app:popUpTo="@id/shareFragment"
app:popUpToInclusive="true"/>
<action
android:id="@+id/action_shareFragment_to_accountProblemFragment"
app:destination="@id/accountProblemFragment" />
<action
android:id="@+id/action_shareFragment_to_addNewDeviceFragment"
app:destination="@id/addNewDeviceFragment" />
@ -754,10 +611,6 @@
android:name="certificateName"
android:defaultValue=" "
app:argType="string" />
<action
android:id="@+id/action_quickSettingsSheetDialogFragment_to_SitePermissionsManagePhoneFeature"
app:destination="@id/SitePermissionsManagePhoneFeature"
app:popUpTo="@id/quickSettingsSheetDialogFragment" />
</dialog>
<fragment
android:id="@+id/accountProblemFragment"
@ -769,9 +622,6 @@
<dialog
android:id="@+id/signOutFragment"
android:name="org.mozilla.fenix.settings.account.SignOutFragment" />
<action
android:id="@+id/action_global_shareFragment"
app:destination="@id/shareFragment" />
<dialog
android:id="@+id/trackingProtectionPanelDialogFragment"
android:name="org.mozilla.fenix.trackingprotection.TrackingProtectionPanelDialogFragment">
@ -788,9 +638,6 @@
android:name="gravity"
android:defaultValue="80"
app:argType="integer" />
<action
android:id="@+id/action_trackingProtectionPanelDialogFragment_to_trackingProtectionFragment"
app:destination="@id/trackingProtectionFragment" />
</dialog>
<fragment
android:id="@+id/trackingProtectionBlockingFragment"
@ -808,11 +655,7 @@
android:name="org.mozilla.fenix.share.AddNewDeviceFragment" />
<fragment
android:id="@+id/defaultBrowserSettingsFragment"
android:name="org.mozilla.fenix.settings.DefaultBrowserSettingsFragment">
<action
android:id="@+id/action_defaultBrowserSettingsFragment_to_browserFragment"
app:destination="@id/browserFragment" />
</fragment>
android:name="org.mozilla.fenix.settings.DefaultBrowserSettingsFragment"/>
<fragment
android:id="@+id/savedLoginsFragment"
android:name="org.mozilla.fenix.settings.logins.SavedLoginsFragment"
@ -820,11 +663,6 @@
<action
android:id="@+id/action_savedLoginsFragment_to_savedLoginSiteInfoFragment"
app:destination="@id/savedLoginSiteInfoFragment" />
<action
android:id="@+id/action_savedLoginsFragment_to_browserFragment"
app:destination="@id/browserFragment"
app:popUpTo="@id/settingsFragment"
app:popUpToInclusive="true" />
</fragment>
<fragment
android:id="@+id/savedLoginSiteInfoFragment"

View File

@ -464,7 +464,7 @@ class DefaultBrowserToolbarControllerTest {
}
verify {
val directions =
BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment(
BrowserFragmentDirections.actionGlobalCollectionCreationFragment(
previousFragmentId = R.id.browserFragment,
saveCollectionStep = SaveCollectionStep.SelectCollection,
tabIds = arrayOf(currentSession.id),
@ -493,7 +493,7 @@ class DefaultBrowserToolbarControllerTest {
}
verify {
val directions =
BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment(
BrowserFragmentDirections.actionGlobalCollectionCreationFragment(
previousFragmentId = R.id.browserFragment,
saveCollectionStep = SaveCollectionStep.NameCollection,
tabIds = arrayOf(currentSession.id),

View File

@ -58,7 +58,7 @@ class CrashReporterControllerTest {
}
@Test
fun `handle close and remove tab`() {
fun `"handle close and remove tab`() {
val controller = CrashReporterController(crash, session, navContoller, components, settings)
controller.handleCloseAndRemove(sendCrash = false)?.joinBlocking()
@ -66,10 +66,7 @@ class CrashReporterControllerTest {
verify { components.useCases.tabsUseCases.removeTab(session) }
verify { components.useCases.sessionUseCases.crashRecovery.invoke() }
verify {
navContoller.navigate(
CrashReporterFragmentDirections.actionCrashReporterFragmentToHomeFragment(),
null
)
navContoller.navigate(CrashReporterFragmentDirections.actionGlobalHome(), null)
}
}

View File

@ -69,7 +69,7 @@ class DeepLinkIntentProcessorTest {
assertTrue(processor.process(testIntent("fenix://home"), navController, out))
verify { activity wasNot Called }
verify { navController.navigate(NavGraphDirections.actionGlobalHomeFragment()) }
verify { navController.navigate(NavGraphDirections.actionGlobalHome()) }
verify { out wasNot Called }
}
@ -123,7 +123,7 @@ class DeepLinkIntentProcessorTest {
assertTrue(processor.process(testIntent("fenix://enable_private_browsing"), navController, out))
verify { activity.browsingModeManager.mode = BrowsingMode.Private }
verify { navController.navigate(NavGraphDirections.actionGlobalHomeFragment()) }
verify { navController.navigate(NavGraphDirections.actionGlobalHome()) }
verify { out wasNot Called }
}

View File

@ -183,7 +183,7 @@ class HistoryControllerTest {
assertEquals(
directions.captured::class.simpleName,
"ActionHistoryFragmentToShareFragment"
"ActionGlobalShareFragment"
)
assertEquals(1, (directions.captured.arguments["data"] as Array<ShareData>).size)
assertEquals(historyItem.title, (directions.captured.arguments["data"] as Array<ShareData>)[0].title)

View File

@ -236,7 +236,7 @@ class DefaultSearchControllerTest {
@Test
fun handleClickSearchEngineSettings() {
val directions: NavDirections =
SearchFragmentDirections.actionSearchFragmentToSearchEngineFragment()
SearchFragmentDirections.actionGlobalSearchEngineFragment()
controller.handleClickSearchEngineSettings()

View File

@ -276,7 +276,7 @@ class SearchInteractorTest {
verify {
navController.navigateSafe(
R.id.searchFragment,
SearchFragmentDirections.actionSearchFragmentToSearchEngineFragment()
SearchFragmentDirections.actionGlobalSearchEngineFragment()
)
}
}

View File

@ -191,7 +191,7 @@ class ShareControllerTest {
metrics.track(Event.SignInToSendTab)
navController.nav(
R.id.shareFragment,
ShareFragmentDirections.actionShareFragmentToTurnOnSyncFragment()
ShareFragmentDirections.actionGlobalTurnOnSync()
)
dismiss(ShareController.Result.DISMISSED)
}
@ -204,7 +204,7 @@ class ShareControllerTest {
verifyOrder {
navController.nav(
R.id.shareFragment,
ShareFragmentDirections.actionShareFragmentToAccountProblemFragment()
ShareFragmentDirections.actionGlobalAccountProblemFragment()
)
dismiss(ShareController.Result.DISMISSED)
}