Bug 1948653 - Rename pageActions to pageActionsEnd r=android-reviewers,tchoh
Differential Revision: https://phabricator.services.mozilla.com/D245955
This commit is contained in:
@@ -60,7 +60,7 @@ fun BrowserToolbar(
|
||||
progressBarConfig = progressBarConfig,
|
||||
browserActionsStart = uiState.displayState.browserActionsStart,
|
||||
pageActionsStart = uiState.displayState.pageActionsStart,
|
||||
pageActions = uiState.displayState.pageActions,
|
||||
pageActionsEnd = uiState.displayState.pageActionsEnd,
|
||||
browserActions = uiState.displayState.browserActions,
|
||||
onInteraction = { store.dispatch(it) },
|
||||
)
|
||||
|
||||
@@ -34,6 +34,7 @@ import mozilla.components.compose.browser.toolbar.store.ProgressBarGravity.Botto
|
||||
import mozilla.components.lib.state.Middleware
|
||||
import mozilla.components.lib.state.MiddlewareContext
|
||||
import org.mozilla.samples.toolbar.R
|
||||
import org.mozilla.samples.toolbar.middleware.PageActionsEndInteractions.RefreshClicked
|
||||
import org.mozilla.samples.toolbar.middleware.PageOriginInteractions.CopyOptionClicked
|
||||
import org.mozilla.samples.toolbar.middleware.PageOriginInteractions.PageOriginClicked
|
||||
import org.mozilla.samples.toolbar.middleware.SearchSelectorInteractions.BookmarksClicked
|
||||
@@ -67,6 +68,10 @@ private sealed class PageOriginInteractions : BrowserToolbarEvent {
|
||||
data object CopyOptionClicked : PageOriginInteractions()
|
||||
}
|
||||
|
||||
private sealed class PageActionsEndInteractions : BrowserToolbarEvent {
|
||||
data object RefreshClicked : PageOriginInteractions()
|
||||
}
|
||||
|
||||
private sealed class TabCounterInteractions : BrowserToolbarEvent {
|
||||
data object TabCounterClicked : TabCounterInteractions()
|
||||
data object Add10TabsClicked : TabCounterInteractions()
|
||||
@@ -102,17 +107,7 @@ internal class BrowserToolbarMiddleware(
|
||||
browserActionsStart = buildStartBrowserActions(),
|
||||
pageActionsStart = buildStartPageActions(),
|
||||
pageOrigin = buildPageOrigin(),
|
||||
pageActions = listOf(
|
||||
ActionButton(
|
||||
icon = iconsR.drawable.mozac_ic_arrow_clockwise_24,
|
||||
contentDescription = R.string.page_action_refresh_description,
|
||||
tint = ContextCompat.getColor(
|
||||
dependencies.context,
|
||||
R.color.generic_button_tint,
|
||||
),
|
||||
onClick = object : BrowserToolbarEvent {},
|
||||
),
|
||||
),
|
||||
pageActionsEnd = buildPageActionsEnd(),
|
||||
browserActions = buildDisplayBrowserActions(),
|
||||
progressBarConfig = buildProgressBar(),
|
||||
),
|
||||
@@ -131,6 +126,7 @@ internal class BrowserToolbarMiddleware(
|
||||
is StartBrowserInteractions,
|
||||
is StartPageInteractions,
|
||||
is PageOriginInteractions,
|
||||
is PageActionsEndInteractions,
|
||||
-> Toast.makeText(dependencies.context, action.javaClass.simpleName, Toast.LENGTH_SHORT).show()
|
||||
|
||||
is TabCounterClicked -> {
|
||||
@@ -195,6 +191,18 @@ internal class BrowserToolbarMiddleware(
|
||||
},
|
||||
)
|
||||
|
||||
private fun buildPageActionsEnd() = listOf(
|
||||
ActionButton(
|
||||
icon = iconsR.drawable.mozac_ic_arrow_clockwise_24,
|
||||
contentDescription = R.string.page_action_refresh_description,
|
||||
tint = ContextCompat.getColor(
|
||||
dependencies.context,
|
||||
R.color.generic_button_tint,
|
||||
),
|
||||
onClick = RefreshClicked,
|
||||
),
|
||||
)
|
||||
|
||||
private fun buildDisplayBrowserActions() = listOf(
|
||||
TabCounterAction(
|
||||
count = currentTabsNumber,
|
||||
|
||||
Reference in New Issue
Block a user