From 149a069f6c51c7d2ddef7bce3537d50cb051a796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montwe=CC=81?= Date: Wed, 10 May 2023 13:12:39 +0200 Subject: [PATCH] Add color property to Text atoms --- .../k9mail/ui/catalog/items/TypographyItems.kt | 15 +++++++++++++++ .../compose/designsystem/atom/text/TextBody1.kt | 3 +++ .../compose/designsystem/atom/text/TextBody2.kt | 3 +++ .../compose/designsystem/atom/text/TextButton.kt | 3 +++ .../compose/designsystem/atom/text/TextCaption.kt | 3 +++ .../designsystem/atom/text/TextHeadline1.kt | 3 +++ .../designsystem/atom/text/TextHeadline2.kt | 3 +++ .../designsystem/atom/text/TextHeadline3.kt | 3 +++ .../designsystem/atom/text/TextHeadline4.kt | 3 +++ .../designsystem/atom/text/TextHeadline5.kt | 3 +++ .../designsystem/atom/text/TextHeadline6.kt | 3 +++ .../designsystem/atom/text/TextOverline.kt | 3 +++ .../designsystem/atom/text/TextSubtitle1.kt | 3 +++ .../designsystem/atom/text/TextSubtitle2.kt | 3 +++ 14 files changed, 54 insertions(+) diff --git a/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/items/TypographyItems.kt b/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/items/TypographyItems.kt index 7ad1735d4..116bb2bd2 100644 --- a/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/items/TypographyItems.kt +++ b/app-ui-catalog/src/main/java/app/k9mail/ui/catalog/items/TypographyItems.kt @@ -1,6 +1,7 @@ package app.k9mail.ui.catalog.items import androidx.compose.foundation.lazy.grid.LazyGridScope +import androidx.compose.ui.graphics.Color import app.k9mail.core.ui.compose.designsystem.atom.text.TextBody1 import app.k9mail.core.ui.compose.designsystem.atom.text.TextBody2 import app.k9mail.core.ui.compose.designsystem.atom.text.TextButton @@ -30,4 +31,18 @@ fun LazyGridScope.typographyItems() { item { TextButton(text = "Button") } item { TextCaption(text = "Caption") } item { TextOverline(text = "Overline") } + sectionSubtitleItem(text = "colored") + item { TextHeadline1(text = "Headline1", color = Color.Magenta) } + item { TextHeadline2(text = "Headline2", color = Color.Magenta) } + item { TextHeadline3(text = "Headline3", color = Color.Magenta) } + item { TextHeadline4(text = "Headline4", color = Color.Magenta) } + item { TextHeadline5(text = "Headline5", color = Color.Magenta) } + item { TextHeadline6(text = "Headline6", color = Color.Magenta) } + item { TextSubtitle1(text = "Subtitle1", color = Color.Magenta) } + item { TextSubtitle2(text = "Subtitle2", color = Color.Magenta) } + item { TextBody1(text = "Body1", color = Color.Magenta) } + item { TextBody2(text = "Body2", color = Color.Magenta) } + item { TextButton(text = "Button", color = Color.Magenta) } + item { TextCaption(text = "Caption", color = Color.Magenta) } + item { TextOverline(text = "Overline", color = Color.Magenta) } } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt index 4c604aaa7..026010671 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody1.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextBody1( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.body1, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody2.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody2.kt index dc125a153..3e8680812 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody2.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextBody2.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextBody2( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.body2, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextButton.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextButton.kt index 31ac9ad99..50f92854b 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextButton.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextButton.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextButton( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text.uppercase(), style = MainTheme.typography.button, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextCaption.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextCaption.kt index 6d81cd36f..ea9d2d196 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextCaption.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextCaption.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextCaption( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.caption, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline1.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline1.kt index bc2f845fd..e25cae598 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline1.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline1.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline1( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h1, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt index 7227cf217..fe0797bff 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline2.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline2( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h2, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline3.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline3.kt index 7b4a44d86..7e09f1d55 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline3.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline3.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline3( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h3, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline4.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline4.kt index 805eb5fc5..997fa1d18 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline4.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline4.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline4( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h4, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline5.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline5.kt index 1d0cd722d..bf0a17540 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline5.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline5.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline5( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h5, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline6.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline6.kt index 3b9a9b7f0..4c6023d57 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline6.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextHeadline6.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextHeadline6( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.h6, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextOverline.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextOverline.kt index 9ec8ae839..5cc8f188f 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextOverline.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextOverline.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextOverline( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text.uppercase(), style = MainTheme.typography.overline, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle1.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle1.kt index a9d69abbc..61cf5d54e 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle1.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle1.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextSubtitle1( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.subtitle1, modifier = modifier, + color = color, ) } diff --git a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle2.kt b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle2.kt index fab6c45b1..0e7392e49 100644 --- a/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle2.kt +++ b/core/ui/compose/designsystem/src/main/kotlin/app/k9mail/core/ui/compose/designsystem/atom/text/TextSubtitle2.kt @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.atom.text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.PreviewWithThemes @@ -11,11 +12,13 @@ import androidx.compose.material.Text as MaterialText fun TextSubtitle2( text: String, modifier: Modifier = Modifier, + color: Color = Color.Unspecified, ) { MaterialText( text = text, style = MainTheme.typography.subtitle2, modifier = modifier, + color = color, ) }