mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/1914 - Removes incomplete actions from Custom Tab Menu
This commit is contained in:
parent
7083f346bf
commit
07fbeaeeba
@ -89,7 +89,6 @@ class ToolbarUIView(
|
||||
|
||||
val menuToolbar = if (isCustom) {
|
||||
CustomTabToolbarMenu(this,
|
||||
requestDesktopStateProvider = { session?.desktopMode ?: false },
|
||||
onItemTapped = { actionEmitter.onNext(SearchAction.ToolbarMenuItemTapped(it)) }
|
||||
)
|
||||
} else {
|
||||
|
@ -9,7 +9,6 @@ import mozilla.components.browser.menu.BrowserMenuBuilder
|
||||
import mozilla.components.browser.menu.item.BrowserMenuDivider
|
||||
import mozilla.components.browser.menu.item.BrowserMenuImageText
|
||||
import mozilla.components.browser.menu.item.BrowserMenuItemToolbar
|
||||
import mozilla.components.browser.menu.item.BrowserMenuSwitch
|
||||
import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
|
||||
import org.mozilla.fenix.DefaultThemeManager
|
||||
import org.mozilla.fenix.R
|
||||
@ -18,7 +17,6 @@ import org.mozilla.fenix.ext.components
|
||||
|
||||
class CustomTabToolbarMenu(
|
||||
private val context: Context,
|
||||
private val requestDesktopStateProvider: () -> Boolean = { false },
|
||||
private val onItemTapped: (ToolbarMenu.Item) -> Unit = {}
|
||||
) : ToolbarMenu {
|
||||
override val menuBuilder by lazy { BrowserMenuBuilder(menuItems) }
|
||||
@ -117,19 +115,6 @@ class CustomTabToolbarMenu(
|
||||
onItemTapped.invoke(ToolbarMenu.Item.OpenInFenix)
|
||||
},
|
||||
|
||||
BrowserMenuImageText(
|
||||
context.getString(R.string.browser_menu_find_in_page),
|
||||
R.drawable.mozac_ic_search,
|
||||
DefaultThemeManager.resolveAttribute(R.attr.primaryText, context)
|
||||
) {
|
||||
onItemTapped.invoke(ToolbarMenu.Item.FindInPage)
|
||||
},
|
||||
|
||||
BrowserMenuSwitch(context.getString(R.string.browser_menu_desktop_site),
|
||||
requestDesktopStateProvider, { checked ->
|
||||
onItemTapped.invoke(ToolbarMenu.Item.RequestDesktop(checked))
|
||||
}),
|
||||
|
||||
BrowserMenuImageText(
|
||||
context.getString(R.string.browser_menu_share),
|
||||
R.drawable.mozac_ic_share,
|
||||
|
@ -22,11 +22,9 @@ class CustomTabsIntegration(
|
||||
onItemTapped: (ToolbarMenu.Item) -> Unit = {}
|
||||
) : LifecycleAwareFeature, BackHandler {
|
||||
|
||||
private val session = sessionManager.findSessionById(sessionId)
|
||||
|
||||
private val customTabToolbarMenu by lazy {
|
||||
CustomTabToolbarMenu(context,
|
||||
requestDesktopStateProvider = { session?.desktopMode ?: false },
|
||||
CustomTabToolbarMenu(
|
||||
context,
|
||||
onItemTapped = onItemTapped
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user