From 7b1dd5b261a10dd941be4d7128338447b9ce57a5 Mon Sep 17 00:00:00 2001 From: Juan David Hurtado Date: Sun, 9 Oct 2022 17:38:52 -0500 Subject: [PATCH] feat: add color to text component --- .../juandahurt/purace/ui/basic/scaffold/PuraceScaffold.kt | 2 +- .../juandahurt/purace/ui/basic/text/PuraceTextView.kt | 8 +++++--- .../juandahurt/puracedemo/examples/basic/TextExample.kt | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Purace/src/main/java/juandahurt/purace/ui/basic/scaffold/PuraceScaffold.kt b/Purace/src/main/java/juandahurt/purace/ui/basic/scaffold/PuraceScaffold.kt index 7ac5940..ff55307 100644 --- a/Purace/src/main/java/juandahurt/purace/ui/basic/scaffold/PuraceScaffold.kt +++ b/Purace/src/main/java/juandahurt/purace/ui/basic/scaffold/PuraceScaffold.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.* import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp -import juandahurt.purace.ui.basic.PuraceTextView +import juandahurt.purace.ui.basic.text.PuraceTextView import juandahurt.purace.ui.style.PuraceStyle @Composable diff --git a/Purace/src/main/java/juandahurt/purace/ui/basic/text/PuraceTextView.kt b/Purace/src/main/java/juandahurt/purace/ui/basic/text/PuraceTextView.kt index 17279e0..150fd52 100644 --- a/Purace/src/main/java/juandahurt/purace/ui/basic/text/PuraceTextView.kt +++ b/Purace/src/main/java/juandahurt/purace/ui/basic/text/PuraceTextView.kt @@ -1,8 +1,9 @@ -package juandahurt.purace.ui.basic +package juandahurt.purace.ui.basic.text import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight @@ -22,7 +23,8 @@ fun PuraceTextView( text: String, size: Int = 12, weight: FontWeight = FontWeight.Normal, - textAlign: TextAlign = TextAlign.Justify + textAlign: TextAlign = TextAlign.Justify, + color: Color = PuraceStyle.Color.N1 ) { Text( modifier = modifier, @@ -31,6 +33,6 @@ fun PuraceTextView( fontWeight = weight, fontSize = size.sp, textAlign = textAlign, - color = PuraceStyle.Color.N1 + color = color ) } \ No newline at end of file diff --git a/app/src/main/java/juandahurt/puracedemo/examples/basic/TextExample.kt b/app/src/main/java/juandahurt/puracedemo/examples/basic/TextExample.kt index 5742b3f..2c0300b 100644 --- a/app/src/main/java/juandahurt/puracedemo/examples/basic/TextExample.kt +++ b/app/src/main/java/juandahurt/puracedemo/examples/basic/TextExample.kt @@ -1,6 +1,5 @@ package juandahurt.puracedemo.examples.basic -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -8,7 +7,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController -import juandahurt.purace.ui.basic.PuraceTextView +import juandahurt.purace.ui.basic.text.PuraceTextView import juandahurt.purace.ui.basic.scaffold.PuraceScaffold @Composable