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:
parent
ad95b57c30
commit
42de52ac1c
@ -13,6 +13,7 @@ import org.mozilla.fenix.ext.components
|
|||||||
|
|
||||||
class TabTrayItemMenu(
|
class TabTrayItemMenu(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
|
private val shouldShowShareAllTabs: () -> Boolean,
|
||||||
private val shouldShowSelectTabs: () -> Boolean,
|
private val shouldShowSelectTabs: () -> Boolean,
|
||||||
private val hasOpenTabs: () -> Boolean,
|
private val hasOpenTabs: () -> Boolean,
|
||||||
private val onItemTapped: (Item) -> Unit = {}
|
private val onItemTapped: (Item) -> Unit = {}
|
||||||
@ -43,7 +44,7 @@ class TabTrayItemMenu(
|
|||||||
) {
|
) {
|
||||||
context.components.analytics.metrics.track(Event.TabsTrayShareAllTabsPressed)
|
context.components.analytics.metrics.track(Event.TabsTrayShareAllTabsPressed)
|
||||||
onItemTapped.invoke(Item.ShareAllTabs)
|
onItemTapped.invoke(Item.ShareAllTabs)
|
||||||
}.apply { visible = hasOpenTabs },
|
}.apply { visible = { shouldShowShareAllTabs() && hasOpenTabs() } },
|
||||||
|
|
||||||
SimpleBrowserMenuItem(
|
SimpleBrowserMenuItem(
|
||||||
context.getString(R.string.tab_tray_menu_tab_settings),
|
context.getString(R.string.tab_tray_menu_tab_settings),
|
||||||
|
@ -226,6 +226,7 @@ class TabTrayView(
|
|||||||
tabTrayItemMenu =
|
tabTrayItemMenu =
|
||||||
TabTrayItemMenu(
|
TabTrayItemMenu(
|
||||||
context = view.context,
|
context = view.context,
|
||||||
|
shouldShowShareAllTabs = { checkOpenTabs.invoke() && view.tab_layout.selectedTabPosition == 0 },
|
||||||
shouldShowSelectTabs = { checkOpenTabs.invoke() && view.tab_layout.selectedTabPosition == 0 },
|
shouldShowSelectTabs = { checkOpenTabs.invoke() && view.tab_layout.selectedTabPosition == 0 },
|
||||||
hasOpenTabs = checkOpenTabs
|
hasOpenTabs = checkOpenTabs
|
||||||
) {
|
) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<!-- Save to collection -->
|
<!-- Save to collection -->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/tab_tray_select_to_save_menu_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" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<!-- Share-->
|
<!-- Share-->
|
||||||
|
@ -581,6 +581,8 @@
|
|||||||
<string name="tab_tray_title">Open Tabs</string>
|
<string name="tab_tray_title">Open Tabs</string>
|
||||||
<!-- Text shown in the menu for saving tabs to a collection -->
|
<!-- Text shown in the menu for saving tabs to a collection -->
|
||||||
<string name="tab_tray_menu_item_save">Save to collection</string>
|
<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 -->
|
<!-- Text shown in the menu for sharing all tabs -->
|
||||||
<string name="tab_tray_menu_item_share">Share all tabs</string>
|
<string name="tab_tray_menu_item_share">Share all tabs</string>
|
||||||
<!-- Text shown in the menu to view recently closed tabs -->
|
<!-- Text shown in the menu to view recently closed tabs -->
|
||||||
|
Loading…
Reference in New Issue
Block a user