diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayItemMenu.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayItemMenu.kt index f7469337b9..15acc46a14 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayItemMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayItemMenu.kt @@ -13,6 +13,7 @@ import org.mozilla.fenix.ext.components class TabTrayItemMenu( private val context: Context, + private val shouldShowShareAllTabs: () -> Boolean, private val shouldShowSelectTabs: () -> Boolean, private val hasOpenTabs: () -> Boolean, private val onItemTapped: (Item) -> Unit = {} @@ -43,7 +44,7 @@ class TabTrayItemMenu( ) { context.components.analytics.metrics.track(Event.TabsTrayShareAllTabsPressed) onItemTapped.invoke(Item.ShareAllTabs) - }.apply { visible = hasOpenTabs }, + }.apply { visible = { shouldShowShareAllTabs() && hasOpenTabs() } }, SimpleBrowserMenuItem( context.getString(R.string.tab_tray_menu_tab_settings), diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt index 0dff1c3a4d..422fefb89f 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt @@ -226,6 +226,7 @@ class TabTrayView( tabTrayItemMenu = TabTrayItemMenu( context = view.context, + shouldShowShareAllTabs = { checkOpenTabs.invoke() && view.tab_layout.selectedTabPosition == 0 }, shouldShowSelectTabs = { checkOpenTabs.invoke() && view.tab_layout.selectedTabPosition == 0 }, hasOpenTabs = checkOpenTabs ) { diff --git a/app/src/main/res/menu/tab_tray_menu.xml b/app/src/main/res/menu/tab_tray_menu.xml index 8eda6eea4b..35c8e87ff2 100644 --- a/app/src/main/res/menu/tab_tray_menu.xml +++ b/app/src/main/res/menu/tab_tray_menu.xml @@ -8,7 +8,7 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2a3a12748a..d4dcd07ec6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -581,6 +581,8 @@ Open Tabs Save to collection + + Select Share all tabs