2019-08-21 23:29:45 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
package org.mozilla.fenix
|
|
|
|
|
|
|
|
import androidx.navigation.NavDirections
|
2020-06-24 22:31:50 +00:00
|
|
|
import mozilla.appservices.places.BookmarkRoot
|
2019-08-21 23:29:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used with [HomeActivity] global navigation to indicate which fragment is being opened.
|
|
|
|
*
|
|
|
|
* @property navDirections NavDirections to navigate to destination
|
|
|
|
* @property destinationId fragment ID of the fragment being navigated to
|
|
|
|
*/
|
|
|
|
enum class GlobalDirections(val navDirections: NavDirections, val destinationId: Int) {
|
2020-04-14 04:43:45 +00:00
|
|
|
Home(NavGraphDirections.actionGlobalHome(), R.id.homeFragment),
|
2020-06-24 22:31:50 +00:00
|
|
|
Bookmarks(
|
|
|
|
NavGraphDirections.actionGlobalBookmarkFragment(BookmarkRoot.Root.id),
|
|
|
|
R.id.bookmarkFragment
|
|
|
|
),
|
|
|
|
History(
|
|
|
|
NavGraphDirections.actionGlobalHistoryFragment(),
|
|
|
|
R.id.historyFragment
|
|
|
|
),
|
2019-08-21 23:29:45 +00:00
|
|
|
Settings(
|
|
|
|
NavGraphDirections.actionGlobalSettingsFragment(),
|
|
|
|
R.id.settingsFragment
|
|
|
|
),
|
|
|
|
Sync(
|
|
|
|
NavGraphDirections.actionGlobalTurnOnSync(),
|
|
|
|
R.id.turnOnSyncFragment
|
|
|
|
),
|
|
|
|
SearchEngine(
|
|
|
|
NavGraphDirections.actionGlobalSearchEngineFragment(),
|
|
|
|
R.id.searchEngineFragment
|
|
|
|
),
|
|
|
|
Accessibility(
|
|
|
|
NavGraphDirections.actionGlobalAccessibilityFragment(),
|
|
|
|
R.id.accessibilityFragment
|
|
|
|
),
|
|
|
|
DeleteData(
|
|
|
|
NavGraphDirections.actionGlobalDeleteBrowsingDataFragment(),
|
|
|
|
R.id.deleteBrowsingDataFragment
|
2020-03-09 19:23:57 +00:00
|
|
|
),
|
|
|
|
SettingsAddonManager(
|
2020-08-27 16:49:32 +00:00
|
|
|
NavGraphDirections.actionGlobalAddonsManagementFragment(),
|
2020-03-09 19:23:57 +00:00
|
|
|
R.id.addonsManagementFragment
|
2020-06-24 22:31:50 +00:00
|
|
|
),
|
|
|
|
SettingsLogins(
|
|
|
|
NavGraphDirections.actionGlobalSavedLoginsAuthFragment(),
|
|
|
|
R.id.saveLoginSettingFragment
|
|
|
|
),
|
|
|
|
SettingsTrackingProtection(
|
|
|
|
NavGraphDirections.actionGlobalTrackingProtectionFragment(),
|
|
|
|
R.id.trackingProtectionFragment
|
2019-08-21 23:29:45 +00:00
|
|
|
)
|
|
|
|
}
|