From 8fa08f31b9dfba7466403d845d73bb59a81da55e Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Fri, 24 Jun 2022 12:27:27 -0400 Subject: [PATCH] For #25750 - Use Headline7 for the expandable list headers that appear in cards --- .../org/mozilla/fenix/compose/list/ExpandableListHeader.kt | 5 ++++- .../java/org/mozilla/fenix/home/collections/Collection.kt | 1 + .../org/mozilla/fenix/tabstray/inactivetabs/InactiveTabs.kt | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/compose/list/ExpandableListHeader.kt b/app/src/main/java/org/mozilla/fenix/compose/list/ExpandableListHeader.kt index 33f43b1f6e..2e1c6fcd0e 100644 --- a/app/src/main/java/org/mozilla/fenix/compose/list/ExpandableListHeader.kt +++ b/app/src/main/java/org/mozilla/fenix/compose/list/ExpandableListHeader.kt @@ -20,6 +20,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.mozilla.fenix.R @@ -30,6 +31,7 @@ import org.mozilla.fenix.theme.Theme * Expandable header for sections of lists * * @param headerText The title of the header. + * @param headerTextStyle The text style of the header. * @param expanded Indicates whether the section of content is expanded. If null, the Icon will be hidden. * @param expandActionContentDescription The content description for expanding the section. * @param collapseActionContentDescription The content description for collapsing the section. @@ -40,6 +42,7 @@ import org.mozilla.fenix.theme.Theme @Composable fun ExpandableListHeader( headerText: String, + headerTextStyle: TextStyle = FirefoxTheme.typography.headline8, expanded: Boolean? = null, expandActionContentDescription: String? = null, collapseActionContentDescription: String? = null, @@ -64,7 +67,7 @@ fun ExpandableListHeader( Text( text = headerText, color = FirefoxTheme.colors.textPrimary, - style = FirefoxTheme.typography.headline8, + style = headerTextStyle, maxLines = 1, ) diff --git a/app/src/main/java/org/mozilla/fenix/home/collections/Collection.kt b/app/src/main/java/org/mozilla/fenix/home/collections/Collection.kt index 6875e305e4..2bb6410b99 100644 --- a/app/src/main/java/org/mozilla/fenix/home/collections/Collection.kt +++ b/app/src/main/java/org/mozilla/fenix/home/collections/Collection.kt @@ -105,6 +105,7 @@ fun Collection( ExpandableListHeader( headerText = collection.title, + headerTextStyle = FirefoxTheme.typography.headline7, expanded = isExpanded, ) { if (isExpanded) { diff --git a/app/src/main/java/org/mozilla/fenix/tabstray/inactivetabs/InactiveTabs.kt b/app/src/main/java/org/mozilla/fenix/tabstray/inactivetabs/InactiveTabs.kt index fe7370a48b..00d5f20fe4 100644 --- a/app/src/main/java/org/mozilla/fenix/tabstray/inactivetabs/InactiveTabs.kt +++ b/app/src/main/java/org/mozilla/fenix/tabstray/inactivetabs/InactiveTabs.kt @@ -138,6 +138,7 @@ private fun InactiveTabsHeader( ) { ExpandableListHeader( headerText = stringResource(R.string.inactive_tabs_title), + headerTextStyle = FirefoxTheme.typography.headline7, expanded = expanded, expandActionContentDescription = stringResource(R.string.inactive_tabs_expand_content_description), collapseActionContentDescription = stringResource(R.string.inactive_tabs_collapse_content_description),