2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] Replace @string/tab_tray_menu_item_save with @string/tab_tray_menu_select, Remove "Share all tabs" option from tab tray's private browsing menu

This commit is contained in:
Bryan Kok 2020-11-14 22:37:56 +08:00 committed by ekager
parent ad95b57c30
commit 42de52ac1c
4 changed files with 6 additions and 2 deletions

View File

@ -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),

View File

@ -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
) {

View File

@ -8,7 +8,7 @@
<!-- Save to collection -->
<item
android:id="@+id/tab_tray_select_to_save_menu_item"
android:title="@string/tab_tray_menu_item_save"
android:title="@string/tab_tray_menu_select"
app:showAsAction="never" />
<!-- Share-->

View File

@ -581,6 +581,8 @@
<string name="tab_tray_title">Open Tabs</string>
<!-- Text shown in the menu for saving tabs to a collection -->
<string name="tab_tray_menu_item_save">Save to collection</string>
<!-- Text shown in the menu for the collection selector -->
<string name="tab_tray_menu_select">Select</string>
<!-- Text shown in the menu for sharing all tabs -->
<string name="tab_tray_menu_item_share">Share all tabs</string>
<!-- Text shown in the menu to view recently closed tabs -->