@ -51,6 +51,32 @@ class HomeMenu(
private val menuCategoryTextColor =
private val menuCategoryTextColor =
ThemeManager . resolveAttribute ( R . attr . menuCategoryText , context )
ThemeManager . resolveAttribute ( R . attr . menuCategoryText , context )
// 'Reconnect' and 'Quit' items aren't needed most of the time, so we'll only create the if necessary.
private val reconnectToSyncItem by lazy {
BrowserMenuHighlightableItem (
context . getString ( R . string . sync _reconnect ) ,
R . drawable . ic _sync _disconnected ,
iconTintColorResource = syncDisconnectedColor ,
textColorResource = primaryTextColor ,
highlight = BrowserMenuHighlight . HighPriority (
backgroundTint = syncDisconnectedBackgroundColor
) ,
isHighlighted = { true }
) {
onItemTapped . invoke ( Item . Sync )
}
}
private val quitItem by lazy {
BrowserMenuImageText (
context . getString ( R . string . delete _browsing _data _on _quit _action ) ,
R . drawable . ic _exit ,
primaryTextColor
) {
onItemTapped . invoke ( Item . Quit )
}
}
private val coreMenuItems by lazy {
private val coreMenuItems by lazy {
val whatsNewItem = BrowserMenuHighlightableItem (
val whatsNewItem = BrowserMenuHighlightableItem (
context . getString ( R . string . browser _menu _whats _new ) ,
context . getString ( R . string . browser _menu _whats _new ) ,
@ -144,30 +170,4 @@ class HomeMenu(
} , lifecycleOwner )
} , lifecycleOwner )
}
}
}
}
// 'Reconnect' and 'Quit' items aren't needed most of the time, so we'll only create the if necessary.
private val reconnectToSyncItem by lazy {
BrowserMenuHighlightableItem (
context . getString ( R . string . sync _reconnect ) ,
R . drawable . ic _sync _disconnected ,
iconTintColorResource = syncDisconnectedColor ,
textColorResource = primaryTextColor ,
highlight = BrowserMenuHighlight . HighPriority (
backgroundTint = syncDisconnectedBackgroundColor
) ,
isHighlighted = { true }
) {
onItemTapped . invoke ( Item . Sync )
}
}
private val quitItem by lazy {
BrowserMenuImageText (
context . getString ( R . string . delete _browsing _data _on _quit _action ) ,
R . drawable . ic _exit ,
primaryTextColor
) {
onItemTapped . invoke ( Item . Quit )
}
}
}
}