From d72e781c48aea81b0ddbed9a695939e583f97413 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 29 Feb 2024 18:36:13 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FEAT]=20LGTMTheme=20=EC=B6=94=EA=B0=80=20(?= =?UTF-8?q?#216)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/common_ui/theme/LGTMTheme.kt | 122 ++++++++++++++++++ .../common_ui/theme/LGTMThemeSystem.kt | 82 ++++++++++++ .../android/common_ui/theme/LGTMTypography.kt | 104 --------------- 3 files changed, 204 insertions(+), 104 deletions(-) create mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTheme.kt create mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMThemeSystem.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTypography.kt diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTheme.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTheme.kt new file mode 100644 index 00000000..09b1a4ce --- /dev/null +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTheme.kt @@ -0,0 +1,122 @@ +package com.lgtm.android.common_ui.theme + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ReadOnlyComposable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +@Composable +fun LGTMTheme( + content: @Composable () -> Unit +) { + val lgtmColorPalette = LGTMColor( + yellow = Color(0xFFfac53d), + blue = Color(0xFF1d74f5), + red = Color(0xFFfe504f), + green = Color(0xFF56ee9b), + black = Color(0xFF030c1b), + transparent_black = Color(0x9E030C1B), + gray_8 = Color(0xFF0b1321), + gray_7 = Color(0xFF172334), + gray_6 = Color(0xFF495569), + gray_5 = Color(0xFF78879f), + gray_4 = Color(0xFFb1bed2), + gray_3 = Color(0xFFcfd8e7), + gray_2 = Color(0xFFe7ecf2), + gray_1 = Color(0xFFf4f5f9), + white = Color(0xFFfcfcfc) + ) + + val lgtmTypography = LGTMTypography( + heading1B = TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 32.sp, + lineHeight = 44.8.sp + ), + heading1M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 32.sp, + lineHeight = 44.8.sp + ), + heading2B = TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 28.sp, + lineHeight = 39.2.sp + ), + heading2M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 28.sp, + lineHeight = 39.2.sp + ), + heading3B = TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 24.sp, + lineHeight = 33.6.sp + ), + heading3M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 24.sp, + lineHeight = 33.6.sp + ), + heading4B = TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 20.sp, + lineHeight = 28.sp + ), + heading4M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 20.sp, + lineHeight = 28.sp + ), + body1B = TextStyle( + fontWeight = FontWeight.Bold, + fontSize = 16.sp, + lineHeight = 22.4.sp + ), + body1M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 22.4.sp + ), + body2 = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 14.sp, + lineHeight = 21.sp + ), + body3M = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 18.sp + ), + body3R = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 18.sp + ), + description = TextStyle( + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 18.sp + ) + ) + + CompositionLocalProvider( + LocalColorPalette provides lgtmColorPalette, + LocalTypography provides lgtmTypography, + content = content + ) +} + +object LGTMTheme { + val colors: LGTMColor + @Composable + @ReadOnlyComposable + get() = LocalColorPalette.current + val typography: LGTMTypography + @Composable + @ReadOnlyComposable + get() = LocalTypography.current +} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMThemeSystem.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMThemeSystem.kt new file mode 100644 index 00000000..8131a095 --- /dev/null +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMThemeSystem.kt @@ -0,0 +1,82 @@ +package com.lgtm.android.common_ui.theme + +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import javax.annotation.concurrent.Immutable + +@Immutable +data class LGTMColor( + val yellow: Color, + val blue: Color, + val red: Color, + val green: Color, + val black: Color, + val transparent_black: Color, + val gray_8: Color, + val gray_7: Color, + val gray_6: Color, + val gray_5: Color, + val gray_4: Color, + val gray_3: Color, + val gray_2: Color, + val gray_1: Color, + val white: Color, +) + +@Immutable +data class LGTMTypography( + val heading1B: TextStyle, + val heading1M: TextStyle, + val heading2B: TextStyle, + val heading2M: TextStyle, + val heading3B: TextStyle, + val heading3M: TextStyle, + val heading4B: TextStyle, + val heading4M: TextStyle, + val body1B: TextStyle, + val body1M: TextStyle, + val body2: TextStyle, + val body3M: TextStyle, + val body3R: TextStyle, + val description: TextStyle +) + +val LocalColorPalette = staticCompositionLocalOf { + LGTMColor( + yellow = Color.Unspecified, + blue = Color.Unspecified, + red = Color.Unspecified, + green = Color.Unspecified, + black = Color.Unspecified, + transparent_black = Color.Unspecified, + gray_8 = Color.Unspecified, + gray_7 = Color.Unspecified, + gray_6 = Color.Unspecified, + gray_5 = Color.Unspecified, + gray_4 = Color.Unspecified, + gray_3 = Color.Unspecified, + gray_2 = Color.Unspecified, + gray_1 = Color.Unspecified, + white = Color.Unspecified, + ) +} + +val LocalTypography = staticCompositionLocalOf { + LGTMTypography( + heading1B = TextStyle.Default, + heading1M = TextStyle.Default, + heading2B = TextStyle.Default, + heading2M = TextStyle.Default, + heading3B = TextStyle.Default, + heading3M = TextStyle.Default, + heading4B = TextStyle.Default, + heading4M = TextStyle.Default, + body1B = TextStyle.Default, + body1M = TextStyle.Default, + body2 = TextStyle.Default, + body3M = TextStyle.Default, + body3R = TextStyle.Default, + description = TextStyle.Default + ) +} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTypography.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTypography.kt deleted file mode 100644 index aec396a3..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/theme/LGTMTypography.kt +++ /dev/null @@ -1,104 +0,0 @@ -package com.lgtm.android.common_ui.theme - -import androidx.compose.runtime.Composable -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.sp - -val Typography.heading1B: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Bold, - fontSize = 32.sp, - lineHeight = 44.8.sp - ) - -val Typography.heading1M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 32.sp, - lineHeight = 44.8.sp - ) - -val Typography.heading2B: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Bold, - fontSize = 28.sp, - lineHeight = 39.2.sp - ) - -val Typography.heading2M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 28.sp, - lineHeight = 39.2.sp - ) - -val Typography.heading3B: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Bold, - fontSize = 24.sp, - lineHeight = 33.6.sp - ) - -val Typography.heading3M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 24.sp, - lineHeight = 33.6.sp - ) - -val Typography.heading4B: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Bold, - fontSize = 20.sp, - lineHeight = 28.sp - ) - -val Typography.heading4M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 20.sp, - lineHeight = 28.sp - ) - -val Typography.body1B: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Bold, - fontSize = 16.sp, - lineHeight =22.4.sp - ) - -val Typography.body1M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 16.sp, - lineHeight = 22.4.sp - ) - -val Typography.body2: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 14.sp, - lineHeight = 21.sp - ) - -val Typography.body3M: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 12.sp, - lineHeight = 18.sp - ) - -val Typography.body3R: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 12.sp, - lineHeight = 18.sp - ) - -val Typography.description: TextStyle - @Composable get() = TextStyle( - fontWeight = FontWeight.Normal, - fontSize = 12.sp, - lineHeight = 18.sp - ) \ No newline at end of file From 5d6923c40e77cf53c955cfac919c40063afa6f44 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 29 Feb 2024 18:39:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FEAT]=20LGTMTheme=20=EC=A0=81=EC=9A=A9=20(?= =?UTF-8?q?#216)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/buttons/BackButton.kt | 4 +-- .../buttons/DialogConfirmationButton.kt | 28 ++++++++++------- .../components/buttons/LikeButton.kt | 13 ++++---- .../components/buttons/MenuButton.kt | 7 ++--- .../dialog/LgtmConfirmationDialog.kt | 30 +++++++++---------- .../components/texts/DateTimeText.kt | 17 +++++------ .../CreateSuggestionActivity.kt | 4 +-- .../presentation/CreateSuggestionScreen.kt | 23 +++++++------- .../ui/detail/SuggestionDetailActivity.kt | 4 +-- .../presentation/SuggestionDetailScreen.kt | 25 +++++++--------- 10 files changed, 75 insertions(+), 80 deletions(-) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/BackButton.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/BackButton.kt index a094c040..9df33665 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/BackButton.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/BackButton.kt @@ -9,10 +9,10 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.lgtm.android.common_ui.R +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.common_ui.util.throttleClickable @Composable @@ -24,7 +24,7 @@ fun BackButton( modifier = modifier .border( width = 1.dp, - color = colorResource(id = R.color.gray_3), + color = LGTMTheme.colors.gray_3, shape = RoundedCornerShape(10.dp) ) .background( diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/DialogConfirmationButton.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/DialogConfirmationButton.kt index 6990ef66..626d48e3 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/DialogConfirmationButton.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/DialogConfirmationButton.kt @@ -3,16 +3,16 @@ package com.lgtm.android.common_ui.components.buttons import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.colorResource +import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp -import com.lgtm.android.common_ui.R -import com.lgtm.android.common_ui.theme.body1M +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.common_ui.util.throttleClickable @Composable @@ -24,13 +24,14 @@ fun DialogConfirmationButton( ) { Box( modifier = modifier + .fillMaxWidth() .background( - color = colorResource(id = confirmBtnBackground.background), + color = confirmBtnBackground.color, shape = RoundedCornerShape(10.dp) ) .border( width = if (confirmBtnBackground == ConfirmButtonBackgroundColor.GREEN) 0.dp else 1.dp, - color = colorResource(id = R.color.gray_3), + color = LGTMTheme.colors.gray_3, shape = RoundedCornerShape(10.dp) ) .throttleClickable( @@ -44,13 +45,20 @@ fun DialogConfirmationButton( vertical = 11.dp ), text = text, - style = Typography.body1M, - color = colorResource(id = R.color.black) + style = LGTMTheme.typography.body1M, + color = LGTMTheme.colors.black ) } } -enum class ConfirmButtonBackgroundColor(val background: Int) { - GREEN(R.color.green), - GRAY(R.color.gray_1) +enum class ConfirmButtonBackgroundColor { + GREEN, + GRAY; + + val color: Color + @Composable + get() = when (this) { + GREEN -> LGTMTheme.colors.green + GRAY -> LGTMTheme.colors.gray_1 + } } \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/LikeButton.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/LikeButton.kt index db1d861e..559e20f0 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/LikeButton.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/LikeButton.kt @@ -7,20 +7,17 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredWidth import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.lgtm.android.common_ui.R -import com.lgtm.android.common_ui.theme.body3R +import com.lgtm.android.common_ui.theme.LGTMTheme @Composable fun LikeButton( @@ -33,11 +30,11 @@ fun LikeButton( modifier = modifier .border( width = 1.dp, - color = colorResource(id = R.color.gray_2), + color = LGTMTheme.colors.gray_2, shape = RoundedCornerShape(10.dp) ) .background( - color = Color.White, + color = LGTMTheme.colors.white, shape = RoundedCornerShape(10.dp) ) .padding( @@ -51,7 +48,7 @@ fun LikeButton( .requiredWidth(30.dp), text = likeNum, textAlign = TextAlign.Center, - style = Typography.body3R + style = LGTMTheme.typography.body3R ) Image( @@ -65,7 +62,7 @@ fun LikeButton( @Preview @Composable fun LikeButtonPreview() { - MaterialTheme { + LGTMTheme { LikeButton( likeNum = "22", isLiked = true diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/MenuButton.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/MenuButton.kt index a2967e8e..20ac6240 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/MenuButton.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/buttons/MenuButton.kt @@ -9,11 +9,10 @@ import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.lgtm.android.common_ui.R +import com.lgtm.android.common_ui.theme.LGTMTheme @Composable fun MenuButton( @@ -24,11 +23,11 @@ fun MenuButton( .wrapContentSize() .border( width = 1.dp, - color = colorResource(id = R.color.gray_3), + color = LGTMTheme.colors.gray_3, shape = RoundedCornerShape(10.dp) ) .background( - color = Color.White, + color = LGTMTheme.colors.white, shape = RoundedCornerShape(10.dp) ) .padding(3.dp) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/dialog/LgtmConfirmationDialog.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/dialog/LgtmConfirmationDialog.kt index 86d56b51..2da485e2 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/dialog/LgtmConfirmationDialog.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/dialog/LgtmConfirmationDialog.kt @@ -11,15 +11,13 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.lgtm.android.common_ui.R import com.lgtm.android.common_ui.components.buttons.ConfirmButtonBackgroundColor import com.lgtm.android.common_ui.components.buttons.DialogConfirmationButton -import com.lgtm.android.common_ui.theme.body1B -import com.lgtm.android.common_ui.theme.description +import com.lgtm.android.common_ui.theme.LGTMTheme @Composable fun LgtmConfirmationDialog( @@ -32,7 +30,7 @@ fun LgtmConfirmationDialog( Column( modifier = Modifier .fillMaxWidth() - .background(color = colorResource(id = R.color.white)), + .background(color = LGTMTheme.colors.white), horizontalAlignment = Alignment.CenterHorizontally ) { DialogDescription(dialogTitle, dialogDescription) @@ -48,15 +46,15 @@ fun DialogDescription( Text( modifier = Modifier.padding(top = 30.dp), text = title, - style = Typography.body1B, - color = colorResource(id = R.color.black) + style = LGTMTheme.typography.body1B, + color = LGTMTheme.colors.black ) description?.let { Text( modifier = Modifier.padding(top = 10.dp), text = description, - style = Typography.description, - color = colorResource(id = R.color.black) + style = LGTMTheme.typography.description, + color = LGTMTheme.colors.black ) } } @@ -92,11 +90,13 @@ fun DialogButtons( @Composable @Preview fun LGTMBottomSheetDialogContentPreview() { - LgtmConfirmationDialog( - dialogTitle = "작성을 중단할까요?", - dialogDescription = "작성한 내용은 저장되지 않아요.", - onClickCancel = {}, - onClickConfirm = {}, - confirmBtnBackground = ConfirmButtonBackgroundColor.GREEN - ) + LGTMTheme { + LgtmConfirmationDialog( + dialogTitle = "작성을 중단할까요?", + dialogDescription = "작성한 내용은 저장되지 않아요.", + onClickCancel = {}, + onClickConfirm = {}, + confirmBtnBackground = ConfirmButtonBackgroundColor.GREEN + ) + } } \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/components/texts/DateTimeText.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/components/texts/DateTimeText.kt index edf21f0d..70a5c490 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/components/texts/DateTimeText.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/components/texts/DateTimeText.kt @@ -7,16 +7,13 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.material.Divider -import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.colorResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.lgtm.android.common_ui.R -import com.lgtm.android.common_ui.theme.description +import com.lgtm.android.common_ui.theme.LGTMTheme @Composable fun DateTimeText( @@ -32,12 +29,12 @@ fun DateTimeText( Text( modifier = Modifier.padding(end = 3.dp), text = date, - style = Typography.description, - color = colorResource(id = R.color.gray_5), + style = LGTMTheme.typography.description, + color = LGTMTheme.colors.gray_5, ) Divider( - color = colorResource(id = R.color.gray_3), + color = LGTMTheme.colors.gray_3, modifier = Modifier .width(1.dp) .fillMaxHeight() @@ -49,8 +46,8 @@ fun DateTimeText( Text( modifier = Modifier.padding(start = 3.dp), text = time, - style = Typography.description, - color = colorResource(id = R.color.gray_5) + style = LGTMTheme.typography.description, + color = LGTMTheme.colors.gray_5 ) } } @@ -58,7 +55,7 @@ fun DateTimeText( @Preview @Composable fun DateTimePreview() { - MaterialTheme { + LGTMTheme { DateTimeText( date = "2021.09.01", time = "오후 12:00" diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/CreateSuggestionActivity.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/CreateSuggestionActivity.kt index 18027ac2..77eff32c 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/CreateSuggestionActivity.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/CreateSuggestionActivity.kt @@ -1,9 +1,9 @@ package com.lgtm.android.mission_suggestion.ui.create_suggestion import androidx.activity.viewModels -import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import com.lgtm.android.common_ui.base.BaseComposeActivity +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.mission_suggestion.ui.create_suggestion.presentation.CreateSuggestionScreen import dagger.hilt.android.AndroidEntryPoint @@ -16,7 +16,7 @@ class CreateSuggestionActivity: BaseComposeActivity() { @Composable override fun Content() { - MaterialTheme { + LGTMTheme { CreateSuggestionScreen( onBackButtonClick = ::setBackButtonClick ) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/presentation/CreateSuggestionScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/presentation/CreateSuggestionScreen.kt index 28ce9f1a..9216ba02 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/presentation/CreateSuggestionScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/create_suggestion/presentation/CreateSuggestionScreen.kt @@ -29,7 +29,6 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalLifecycleOwner -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView @@ -41,9 +40,7 @@ import com.lgtm.android.common_ui.components.buttons.BackButton import com.lgtm.android.common_ui.components.buttons.ConfirmButtonBackgroundColor import com.lgtm.android.common_ui.components.dialog.LgtmConfirmationDialog import com.lgtm.android.common_ui.model.EditTextData -import com.lgtm.android.common_ui.theme.body1M -import com.lgtm.android.common_ui.theme.body2 -import com.lgtm.android.common_ui.theme.heading4B +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.common_ui.ui.LGTMEditText import com.lgtm.android.common_ui.util.UiState import com.lgtm.android.common_ui.util.throttleClickable @@ -72,7 +69,7 @@ fun CreateSuggestionScreen( topStart = 20.dp, topEnd = 20.dp ), - scrimColor = colorResource(id = R.color.transparent_black), + scrimColor = LGTMTheme.colors.transparent_black, sheetContent = { LgtmConfirmationDialog( dialogTitle = stringResource(id = R.string.want_to_stop_creating_suggestion), @@ -95,7 +92,7 @@ fun CreateSuggestionScreen( ConstraintLayout( modifier = Modifier .fillMaxHeight() - .background(color = colorResource(id = R.color.white)) + .background(color = LGTMTheme.colors.white) .imePadding() ) { @@ -186,7 +183,7 @@ fun CreateSuggestionNextButton( .fillMaxWidth() .padding(horizontal = 20.dp) .background( - color = if (enabledState) colorResource(id = R.color.green) else colorResource(id = R.color.gray_2), + color = if (enabledState) LGTMTheme.colors.green else LGTMTheme.colors.gray_2, shape = RoundedCornerShape(5.dp) ) .throttleClickable(enabledState) { @@ -199,8 +196,8 @@ fun CreateSuggestionNextButton( modifier = Modifier .padding(vertical = 14.dp), text = stringResource(id = R.string.suggestion_next), - style = Typography.body1M, - color = if (enabledState) colorResource(id = R.color.black) else colorResource(id = R.color.gray_4) + style = LGTMTheme.typography.body1M, + color = if (enabledState) LGTMTheme.colors.black else LGTMTheme.colors.gray_4 ) } } @@ -345,14 +342,14 @@ fun SubTitleWithDescription( Text( modifier = Modifier.padding(bottom = 10.dp), text = stringResource(id = subTitle), - style = Typography.heading4B, - color = colorResource(id = R.color.black) + style = LGTMTheme.typography.heading4B, + color = LGTMTheme.colors.black ) Text( modifier = Modifier.padding(bottom = 14.dp), text = stringResource(id = description), - style = Typography.body2, - color = colorResource(id = R.color.gray_6) + style = LGTMTheme.typography.body2, + color = LGTMTheme.colors.gray_6 ) } \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailActivity.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailActivity.kt index 7361450b..9edc0cbb 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailActivity.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailActivity.kt @@ -2,10 +2,10 @@ package com.lgtm.android.mission_suggestion.ui.detail import android.os.Bundle import androidx.activity.viewModels -import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.lgtm.android.common_ui.base.BaseComposeActivity +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.mission_suggestion.ui.detail.presentation.SuggestionDetailScreen import dagger.hilt.android.AndroidEntryPoint @@ -20,7 +20,7 @@ class SuggestionDetailActivity: BaseComposeActivity(){ @Composable override fun Content() { - MaterialTheme { + LGTMTheme { SuggestionDetailScreen( suggestionDetailStateHolder = suggestionDetailViewModel.detailState.collectAsStateWithLifecycle() ) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/presentation/SuggestionDetailScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/presentation/SuggestionDetailScreen.kt index 71ecafa9..e186300c 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/presentation/SuggestionDetailScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/presentation/SuggestionDetailScreen.kt @@ -14,7 +14,6 @@ import androidx.compose.runtime.State import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.lgtm.android.common_ui.R @@ -23,9 +22,7 @@ import com.lgtm.android.common_ui.components.buttons.LikeButton import com.lgtm.android.common_ui.components.buttons.MenuButton import com.lgtm.android.common_ui.components.texts.DateTimeText import com.lgtm.android.common_ui.model.SuggestionUI -import com.lgtm.android.common_ui.theme.body1B -import com.lgtm.android.common_ui.theme.body2 -import com.lgtm.android.common_ui.theme.heading3B +import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.common_ui.util.UiState @Composable @@ -34,7 +31,7 @@ fun SuggestionDetailScreen( ) { Column( modifier = Modifier - .background(colorResource(id = R.color.gray_3)), + .background(LGTMTheme.colors.gray_3), horizontalAlignment = Alignment.CenterHorizontally ) { SuggestionDetailContent( @@ -75,8 +72,8 @@ fun SuggestionDetailContent( Text( modifier = Modifier.padding(horizontal = 20.dp), text = suggestionDetailState.data.title, - style = Typography.heading3B, - color = Color.Black + style = LGTMTheme.typography.heading3B, + color = LGTMTheme.colors.black ) DateTimeText( @@ -90,7 +87,7 @@ fun SuggestionDetailContent( Divider( modifier = Modifier.padding(horizontal = 20.dp), - color = colorResource(id = R.color.gray_2), + color = LGTMTheme.colors.gray_2, thickness = 1.dp ) @@ -101,8 +98,8 @@ fun SuggestionDetailContent( end = 20.dp ), text = suggestionDetailState.data.description, - style = Typography.body2, - color = Color.Black + style = LGTMTheme.typography.body2, + color = LGTMTheme.colors.black ) } } @@ -127,7 +124,7 @@ fun SuggestionLikeSection( modifier = modifier .fillMaxWidth() .background( - color = colorResource(id = R.color.gray_2), + color = LGTMTheme.colors.gray_2, shape = RoundedCornerShape(20.dp) ) .padding( @@ -139,8 +136,8 @@ fun SuggestionLikeSection( ) { Text( text = stringResource(id = R.string.want_this_mission), - style = Typography.body1B, - color = colorResource(id = R.color.gray_6) + style = LGTMTheme.typography.body1B, + color = LGTMTheme.colors.gray_6 ) LikeButton( @@ -168,7 +165,7 @@ fun SuggestionDetailTopBar() { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween ) { - BackButton() { /* TODO */ } + BackButton { /* TODO */ } MenuButton() } } \ No newline at end of file