diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt b/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt index 32de42a9f..19581bbae 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt @@ -51,6 +51,32 @@ class HomeMenu( private val menuCategoryTextColor = 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 { val whatsNewItem = BrowserMenuHighlightableItem( context.getString(R.string.browser_menu_whats_new), @@ -144,30 +170,4 @@ class HomeMenu( }, 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) - } - } }