2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00
* Remove nav in homescreen three dot menu

* Remove back and forward items
This commit is contained in:
Elise Richards 2021-04-12 13:05:58 -05:00 committed by GitHub
parent 22176de02c
commit 298c4c2814

View File

@ -19,7 +19,6 @@ import mozilla.components.browser.menu.item.BrowserMenuDivider
import mozilla.components.browser.menu.item.BrowserMenuHighlightableItem
import mozilla.components.browser.menu.item.BrowserMenuImageSwitch
import mozilla.components.browser.menu.item.BrowserMenuImageText
import mozilla.components.browser.menu.item.BrowserMenuItemToolbar
import mozilla.components.concept.sync.AccountObserver
import mozilla.components.concept.sync.AuthType
import mozilla.components.concept.sync.OAuthAccount
@ -43,9 +42,6 @@ class HomeMenu(
private val onHighlightPresent: (BrowserMenuHighlight) -> Unit = {}
) {
sealed class Item {
data class Back(val viewHistory: Boolean) : Item()
data class Forward(val viewHistory: Boolean) : Item()
object Bookmarks : Item()
object History : Item()
object Downloads : Item()
@ -95,34 +91,6 @@ class HomeMenu(
}
}
val menuToolbar by lazy {
val back = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = mozilla.components.ui.icons.R.drawable.mozac_ic_back,
primaryContentDescription = context.getString(R.string.browser_menu_back),
primaryImageTintResource = primaryTextColor,
isInPrimaryState = { false },
secondaryImageTintResource = ThemeManager.resolveAttribute(R.attr.disabled, context),
disableInSecondaryState = true,
longClickListener = { onItemTapped.invoke(Item.Back(viewHistory = true)) }
) {
onItemTapped.invoke(Item.Back(viewHistory = false))
}
val forward = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = mozilla.components.ui.icons.R.drawable.mozac_ic_forward,
primaryContentDescription = context.getString(R.string.browser_menu_forward),
primaryImageTintResource = primaryTextColor,
isInPrimaryState = { false },
secondaryImageTintResource = ThemeManager.resolveAttribute(R.attr.disabled, context),
disableInSecondaryState = true,
longClickListener = { onItemTapped.invoke(Item.Forward(viewHistory = true)) }
) {
onItemTapped.invoke(Item.Forward(viewHistory = false))
}
BrowserMenuItemToolbar(listOf(back, forward))
}
private val oldCoreMenuItems by lazy {
val whatsNewItem = BrowserMenuHighlightableItem(
context.getString(R.string.browser_menu_whats_new),
@ -368,7 +336,6 @@ class HomeMenu(
}
val menuItems = listOfNotNull(
if (shouldUseBottomToolbar) null else menuToolbar,
bookmarksItem,
historyItem,
downloadsItem,
@ -381,9 +348,7 @@ class HomeMenu(
whatsNewItem,
helpItem,
settingsItem,
if (settings.shouldDeleteBrowsingDataOnQuit) quitItem else null,
if (shouldUseBottomToolbar) BrowserMenuDivider() else null,
if (shouldUseBottomToolbar) menuToolbar else null
if (settings.shouldDeleteBrowsingDataOnQuit) quitItem else null
).also { items ->
items.getHighlight()?.let { onHighlightPresent(it) }
}