commit c86b17c4aa6681060887db63a493f787c17bfbfa parent fdb6e248181505a8e526ca751577c8cde0b108c7 Author: Devota Aabel <daabel@mozilla.com> Date: Fri, 5 Dec 2025 15:53:42 +0000 Bug 2003717- Update Show all text button for stories to All stories. r=gl,android-reviewers,android-l10n-reviewers,flod Differential Revision: https://phabricator.services.mozilla.com/D275090 Diffstat:
4 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/compose/home/HomeSectionHeader.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/compose/home/HomeSectionHeader.kt @@ -42,22 +42,24 @@ import mozilla.components.ui.icons.R as iconsR * * @param headerText The header string. * @param modifier Modifier to apply. - * @param description The content description for the "Show all" button. - * @param onShowAllClick Invoked when "Show all" button is clicked. + * @param description The content description for the button. + * @param buttonText The text to show for the button. + * @param onButtonClick Invoked when the button is clicked. */ @Composable fun HomeSectionHeader( headerText: String, modifier: Modifier = Modifier, description: String = "", - onShowAllClick: (() -> Unit)? = null, + buttonText: String = stringResource(id = R.string.recent_tabs_show_all), + onButtonClick: (() -> Unit)? = null, ) { if (inComposePreview) { HomeSectionHeaderContent( headerText = headerText, modifier = modifier, description = description, - onShowAllClick = onShowAllClick, + onButtonClick = onButtonClick, ) } else { val wallpaperState = components.appStore @@ -77,7 +79,8 @@ fun HomeSectionHeader( } else { wallpaperAdaptedTextColor ?: MaterialTheme.colorScheme.onSurface }, - onShowAllClick = onShowAllClick, + buttonText = buttonText, + onButtonClick = onButtonClick, ) } } @@ -88,9 +91,10 @@ fun HomeSectionHeader( * @param headerText The header string. * @param modifier Modifier to apply. * @param textColor [Color] to apply to the text. - * @param description The content description for the "Show all" button. - * @param buttonColor [Color] for the "Show all" button contents. - * @param onShowAllClick Invoked when "Show all" button is clicked. + * @param description The content description for the button. + * @param buttonColor [Color] for the button contents. + * @param buttonText The text to show for the button. + * @param onButtonClick Invoked when the button is clicked. */ @Composable private fun HomeSectionHeaderContent( @@ -99,7 +103,8 @@ private fun HomeSectionHeaderContent( textColor: Color = MaterialTheme.colorScheme.onSurface, description: String = "", buttonColor: Color = MaterialTheme.colorScheme.onSurface, - onShowAllClick: (() -> Unit)? = null, + buttonText: String = stringResource(id = R.string.recent_tabs_show_all), + onButtonClick: (() -> Unit)? = null, ) { Row( modifier = modifier.fillMaxWidth(), @@ -119,15 +124,15 @@ private fun HomeSectionHeaderContent( Spacer(modifier = Modifier.width(FirefoxTheme.layout.space.dynamic100)) - onShowAllClick?.let { + onButtonClick?.let { TextButton( - onClick = { onShowAllClick() }, + onClick = { onButtonClick() }, colors = ButtonDefaults.textButtonColors( contentColor = buttonColor, ), ) { Text( - text = stringResource(id = R.string.recent_tabs_show_all), + text = buttonText, modifier = Modifier .semantics { contentDescription = description @@ -155,7 +160,7 @@ private fun HomeSectionsHeaderPreview() { headerText = stringResource(R.string.home_bookmarks_title), modifier = Modifier.padding(horizontal = FirefoxTheme.layout.size.static300), description = stringResource(R.string.home_bookmarks_show_all_content_description), - onShowAllClick = {}, + onButtonClick = {}, ) } } @@ -170,7 +175,7 @@ private fun HomeSectionsHeaderPrivatePreview() { headerText = stringResource(R.string.home_bookmarks_title), modifier = Modifier.padding(horizontal = FirefoxTheme.layout.size.static300), description = stringResource(R.string.home_bookmarks_show_all_content_description), - onShowAllClick = {}, + onButtonClick = {}, ) } } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ui/PocketSection.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/pocket/ui/PocketSection.kt @@ -54,7 +54,8 @@ fun PocketSection( headerText = stringResource(R.string.pocket_stories_header_2), modifier = Modifier.padding(horizontal = horizontalPadding), description = stringResource(R.string.stories_discover_more_content_description), - onShowAllClick = if (state.showDiscoverMoreButton) { + buttonText = stringResource(R.string.homepage_all_stories), + onButtonClick = if (state.showDiscoverMoreButton) { interactor::onDiscoverMoreClicked } else { null diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/Homepage.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/Homepage.kt @@ -276,7 +276,7 @@ internal fun TopSitesSection( headerText = stringResource(R.string.homepage_shortcuts_title), modifier = Modifier.padding(horizontal = horizontalMargin), description = stringResource(R.string.homepage_shortcuts_show_all_content_description), - onShowAllClick = interactor::onShowAllTopSitesClicked, + onButtonClick = interactor::onShowAllTopSitesClicked, ) Spacer(Modifier.height(16.dp)) @@ -301,7 +301,7 @@ private fun RecentTabsSection( HomeSectionHeader( headerText = stringResource(R.string.recent_tabs_header), description = stringResource(R.string.recent_tabs_show_all_content_description_2), - onShowAllClick = interactor::onRecentTabShowAllClicked, + onButtonClick = interactor::onRecentTabShowAllClicked, ) Spacer(Modifier.height(16.dp)) @@ -336,7 +336,7 @@ private fun BookmarksSection( headerText = stringResource(R.string.home_bookmarks_title), modifier = Modifier.padding(horizontal = horizontalMargin), description = stringResource(R.string.home_bookmarks_show_all_content_description), - onShowAllClick = interactor::onShowAllBookmarksClicked, + onButtonClick = interactor::onShowAllBookmarksClicked, ) Spacer(Modifier.height(16.dp)) @@ -366,7 +366,7 @@ private fun RecentlyVisitedSection( HomeSectionHeader( headerText = stringResource(R.string.history_metadata_header_2), description = stringResource(R.string.past_explorations_show_all_content_description_2), - onShowAllClick = interactor::onHistoryShowAllClicked, + onButtonClick = interactor::onHistoryShowAllClicked, ) } diff --git a/mobile/android/fenix/app/src/main/res/values/strings.xml b/mobile/android/fenix/app/src/main/res/values/strings.xml @@ -54,6 +54,8 @@ <string name="tab_manager_empty_synced_tabs_page_description">Sign in to manage synced tabs from all your devices.</string> <!-- The action text displayed on the synced tabs page when the user is not logged into an account, prompting the user to sign into their account. When clicked, it takes the user to the account sign-in flow. --> <string name="tab_manager_empty_synced_tabs_page_sign_in_cta">Sign in</string> + <!-- Text for the button used to show all stories --> + <string name="homepage_all_stories">All stories</string> <!-- Home - Bookmarks --> <!-- Title for the home screen section with bookmarks. -->