Skip to content

Commit

Permalink
For mozilla-mobile#21226 only show the "Customize Home" menu on home …
Browse files Browse the repository at this point in the history
…screen.
  • Loading branch information
Amejia481 authored and mergify[bot] committed Sep 13, 2021
1 parent de59a3e commit fe914dc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ class DefaultBrowserToolbarMenuController(
val directions = BrowserFragmentDirections.actionBrowserFragmentToSettingsFragment()
navController.nav(R.id.browserFragment, directions)
}
is ToolbarMenu.Item.CustomizeHome -> browserAnimator.captureEngineViewAndDrawStatically {
val directions = BrowserFragmentDirections.actionBrowserFragmentToCustomFragment()
navController.nav(R.id.browserFragment, directions)
}
is ToolbarMenu.Item.SyncAccount -> {
val directions = when (item.accountState) {
AccountState.AUTHENTICATED ->
Expand Down Expand Up @@ -388,7 +384,6 @@ class DefaultBrowserToolbarMenuController(
is ToolbarMenu.Item.Stop -> Event.BrowserMenuItemTapped.Item.STOP
is ToolbarMenu.Item.Share -> Event.BrowserMenuItemTapped.Item.SHARE
is ToolbarMenu.Item.Settings -> Event.BrowserMenuItemTapped.Item.SETTINGS
is ToolbarMenu.Item.CustomizeHome -> return
is ToolbarMenu.Item.RequestDesktop ->
if (item.isChecked) {
Event.BrowserMenuItemTapped.Item.DESKTOP_VIEW_ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import mozilla.components.feature.webcompat.reporter.WebCompatReporterFeature
import mozilla.components.lib.state.ext.flowScoped
import mozilla.components.support.ktx.android.content.getColorFromAttr
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifAnyChanged
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.components.accounts.FenixAccountManager
import org.mozilla.fenix.experiments.ExperimentBranch
Expand Down Expand Up @@ -309,14 +308,6 @@ open class DefaultToolbarMenu(
onItemTapped.invoke(ToolbarMenu.Item.Settings)
}

val customizeHomeItem = BrowserMenuImageText(
label = context.getString(R.string.browser_menu_customize_home),
imageResource = R.drawable.ic_customize,
iconTintColorResource = primaryTextColor()
) {
onItemTapped.invoke(ToolbarMenu.Item.CustomizeHome)
}

val bookmarksItem = BrowserMenuImageTextCheckboxButton(
imageResource = R.drawable.ic_bookmarks_menu,
iconTintColorResource = primaryTextColor(),
Expand Down Expand Up @@ -381,7 +372,6 @@ open class DefaultToolbarMenu(
addToTopSitesItem,
saveToCollectionItem,
BrowserMenuDivider(),
if (FeatureFlags.customizeHome) customizeHomeItem else null,
settingsItem,
if (shouldDeleteDataOnQuit) deleteDataOnQuit else null,
if (shouldUseBottomToolbar) BrowserMenuDivider() else null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ interface ToolbarMenu {
object History : Item()
object Downloads : Item()
object NewTab : Item()
object CustomizeHome : Item()
}

val menuBuilder: BrowserMenuBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,6 @@ class DefaultBrowserToolbarMenuControllerTest {
verify { navController.navigate(directions, null) }
}

@Test
fun `WHEN CustomizeHome menu item is pressed THEN menu item is handled`() = runBlockingTest {
val item = ToolbarMenu.Item.CustomizeHome

val controller = createController(scope = this, store = browserStore)
controller.handleToolbarItemInteraction(item)

val directions = BrowserFragmentDirections.actionBrowserFragmentToCustomFragment()

verify { navController.navigate(directions, null) }
}

@Test
fun `WHEN bookmark menu item is pressed THEN navigate to bookmarks page`() = runBlockingTest {
val item = ToolbarMenu.Item.Bookmarks
Expand Down

0 comments on commit fe914dc

Please sign in to comment.