For #13168 - Removed the close button from history navigation bar

pull/216/head
Shen 4 years ago committed by Gabriel Luong
parent 850d41a727
commit 45e3f7805b

@ -340,14 +340,4 @@ class HistoryTest {
verifyShareTabUrl()
}
}
@Test
fun verifyCloseMenu() {
homeScreen {
}.openThreeDotMenu {
}.openHistory {
}.closeMenu {
verifyHomeScreen()
}
}
}

@ -84,16 +84,7 @@ class HistoryRobot {
fun verifyDeleteSnackbarText(text: String) = assertSnackBarText(text)
class Transition {
fun closeMenu(interact: HistoryRobot.() -> Unit): Transition {
closeButton().click()
HistoryRobot().interact()
return Transition()
}
fun goBackToBrowser(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
closeButton().click()
BrowserRobot().interact()
return BrowserRobot.Transition()
}
@ -114,8 +105,6 @@ fun historyMenu(interact: HistoryRobot.() -> Unit): HistoryRobot.Transition {
return HistoryRobot.Transition()
}
private fun closeButton() = onView(withId(R.id.close_history))
private fun testPageTitle() = onView(allOf(withId(R.id.title), withText("Test_Page_1")))
private fun pageUrl() = onView(withId(R.id.url))

@ -161,27 +161,17 @@ class HistoryFragment : LibraryPageFragment<HistoryItem>(), UserInteractionHandl
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
val menuRes = when (historyStore.state.mode) {
HistoryFragmentState.Mode.Normal -> R.menu.library_menu
is HistoryFragmentState.Mode.Syncing -> R.menu.library_menu
is HistoryFragmentState.Mode.Editing -> R.menu.history_select_multi
if (historyStore.state.mode is HistoryFragmentState.Mode.Editing) {
inflater.inflate(R.menu.history_select_multi, menu)
menu.findItem(R.id.share_history_multi_select)?.isVisible = true
menu.findItem(R.id.delete_history_multi_select)?.title =
SpannableString(getString(R.string.bookmark_menu_delete_button)).apply {
setTextColor(requireContext(), R.attr.destructive)
}
}
inflater.inflate(menuRes, menu)
menu.findItem(R.id.share_history_multi_select)?.isVisible = true
menu.findItem(R.id.delete_history_multi_select)?.title =
SpannableString(getString(R.string.bookmark_menu_delete_button)).apply {
setTextColor(requireContext(), R.attr.destructive)
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) {
R.id.close_history -> {
close()
true
}
R.id.share_history_multi_select -> {
val selectedHistory = historyStore.state.mode.selectedItems
val shareTabs = selectedHistory.map { ShareData(url = it.url, title = it.title) }

Loading…
Cancel
Save