mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
[fenix] Followup for https://github.com/mozilla-mobile/fenix/issues/11442 - Add tab counter menu metrics to home fragment.
This commit is contained in:
parent
4350ff4b25
commit
1aaf9108c7
@ -627,11 +627,13 @@ class HomeFragment : Fragment() {
|
|||||||
val isPrivate = (activity as HomeActivity).browsingModeManager.mode == BrowsingMode.Private
|
val isPrivate = (activity as HomeActivity).browsingModeManager.mode == BrowsingMode.Private
|
||||||
val menuItems = listOf(
|
val menuItems = listOf(
|
||||||
BrowserMenuImageText(
|
BrowserMenuImageText(
|
||||||
label = context.getString(if (isPrivate) {
|
label = context.getString(
|
||||||
|
if (isPrivate) {
|
||||||
R.string.browser_menu_new_tab
|
R.string.browser_menu_new_tab
|
||||||
} else {
|
} else {
|
||||||
R.string.home_screen_shortcut_open_new_private_tab_2
|
R.string.home_screen_shortcut_open_new_private_tab_2
|
||||||
}),
|
}
|
||||||
|
),
|
||||||
imageResource = if (isPrivate) {
|
imageResource = if (isPrivate) {
|
||||||
R.drawable.ic_new
|
R.drawable.ic_new
|
||||||
} else {
|
} else {
|
||||||
@ -640,6 +642,15 @@ class HomeFragment : Fragment() {
|
|||||||
iconTintColorResource = primaryTextColor,
|
iconTintColorResource = primaryTextColor,
|
||||||
textColorResource = primaryTextColor
|
textColorResource = primaryTextColor
|
||||||
) {
|
) {
|
||||||
|
requireComponents.analytics.metrics.track(
|
||||||
|
Event.TabCounterMenuItemTapped(
|
||||||
|
if (isPrivate) {
|
||||||
|
Event.TabCounterMenuItemTapped.Item.NEW_TAB
|
||||||
|
} else {
|
||||||
|
Event.TabCounterMenuItemTapped.Item.NEW_PRIVATE_TAB
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
(activity as HomeActivity).browsingModeManager.mode =
|
(activity as HomeActivity).browsingModeManager.mode =
|
||||||
BrowsingMode.fromBoolean(!isPrivate)
|
BrowsingMode.fromBoolean(!isPrivate)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user