2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Fixes #9696: Adds Add-ons menu item to the home menu

This commit is contained in:
ValentinTimisica 2020-05-05 17:01:57 +03:00 committed by Emily Kager
parent 1c367080a5
commit 591e2c9a6f
2 changed files with 17 additions and 0 deletions

View File

@ -741,6 +741,12 @@ class HomeFragment : Fragment() {
HomeFragmentDirections.actionGlobalAccountProblemFragment()
)
}
HomeMenu.Item.AddonsManager -> {
nav(
R.id.homeFragment,
HomeFragmentDirections.actionGlobalAddonsManagementFragment()
)
}
}
},
onHighlightPresent = { menuButtonView.get()?.setHighlight(it) },

View File

@ -39,6 +39,7 @@ class HomeMenu(
sealed class Item {
object WhatsNew : Item()
object Help : Item()
object AddonsManager : Item()
object Settings : Item()
object SyncedTabs : Item()
object History : Item()
@ -112,6 +113,14 @@ class HomeMenu(
onItemTapped.invoke(Item.History)
}
val addons = BrowserMenuImageText(
context.getString(R.string.browser_menu_add_ons),
R.drawable.mozac_ic_extensions,
primaryTextColor
) {
onItemTapped.invoke(Item.AddonsManager)
}
val settingsItem = BrowserMenuImageText(
context.getString(R.string.browser_menu_settings),
R.drawable.ic_settings,
@ -153,6 +162,7 @@ class HomeMenu(
historyItem,
if (FeatureFlags.syncedTabs) syncedTabsItem else null,
BrowserMenuDivider(),
addons,
settingsItem,
helpItem,
if (Settings.getInstance(context).shouldDeleteBrowsingDataOnQuit) quitItem else null
@ -164,6 +174,7 @@ class HomeMenu(
if (Settings.getInstance(context).shouldDeleteBrowsingDataOnQuit) quitItem else null,
helpItem,
settingsItem,
addons,
accountAuthItem,
BrowserMenuDivider(),
bookmarksItem,