2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-11 13:11:01 +00:00

For #1092: Fixes ordering of custom tab menu items (#2072)

This commit is contained in:
Sawyer Blatz 2019-04-26 13:54:38 -07:00 committed by GitHub
parent 11918d45f4
commit 4cd0d464a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 15 deletions

View File

@ -91,17 +91,17 @@ class CustomTabToolbarMenu(
private val menuItems by lazy {
listOf(
SimpleBrowserMenuItem(
{
val appName = context.getString(R.string.app_name)
context.getString(R.string.browser_menu_powered_by, appName).toUpperCase()
}(),
ToolbarMenu.CAPTION_TEXT_SIZE,
DefaultThemeManager.resolveAttribute(R.attr.primaryText, context)
),
menuToolbar,
BrowserMenuDivider(),
BrowserMenuImageText(
context.getString(R.string.browser_menu_share),
R.drawable.mozac_ic_share
) {
onItemTapped.invoke(ToolbarMenu.Item.Share)
},
SimpleBrowserMenuItem(
{
val appName = context.getString(R.string.app_name)
@ -115,14 +115,16 @@ class CustomTabToolbarMenu(
onItemTapped.invoke(ToolbarMenu.Item.OpenInFenix)
},
BrowserMenuImageText(
context.getString(R.string.browser_menu_share),
R.drawable.mozac_ic_share,
BrowserMenuDivider(),
SimpleBrowserMenuItem(
{
val appName = context.getString(R.string.app_name)
context.getString(R.string.browser_menu_powered_by, appName).toUpperCase()
}(),
ToolbarMenu.CAPTION_TEXT_SIZE,
DefaultThemeManager.resolveAttribute(R.attr.primaryText, context)
) {
onItemTapped.invoke(ToolbarMenu.Item.Share)
},
menuToolbar
)
)
}
}

View File

@ -34,6 +34,7 @@ class CustomTabsIntegration(
toolbar,
sessionId,
customTabToolbarMenu.menuBuilder,
START_OF_MENU_ITEMS_INDEX,
closeListener = { activity?.finish() })
override fun start() {
@ -47,4 +48,8 @@ class CustomTabsIntegration(
override fun onBackPressed(): Boolean {
return feature.onBackPressed()
}
companion object {
const val START_OF_MENU_ITEMS_INDEX = 2
}
}