mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/18960: Remove nav in homescreen three dot menu (https://github.com/mozilla-mobile/fenix/pull/18962)
* Remove nav in homescreen three dot menu * Remove back and forward items
This commit is contained in:
parent
22176de02c
commit
298c4c2814
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user