Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

designsystem module (Background, Gradient 추가) #14

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions core/designsystem/src/main/java/com/moya/funch/theme/Theme.kt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹 컴포즈에서 이렇게 테마를 설정하는구나???? 한수 배우고 갑니다,,,

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ private val LocalFunchTypography = staticCompositionLocalOf<FunchTypography> {
error("No FunchTypography provided")
}

private val DarkGradientColors =
GradientColors(top = Gray900, bottom = Gray900)

private val DarkAndroidBackgroundTheme = BackgroundTheme(color = Gray900)

object FunchTheme {
val colors: FunchColorSchema @Composable get() = LocalFunchColors.current
val typography: FunchTypography @Composable get() = LocalFunchTypography.current
Expand All @@ -39,9 +44,17 @@ fun FunchTheme(
) {
// this version provides only dark theme
val colors = funchDarkColorSchema()
val gradientColors = DarkGradientColors
val typography = funchTypography()
ProvidePophoryColorAndTypography(colors, typography) {
MaterialTheme(content = content)
val backgroundTheme = DarkAndroidBackgroundTheme

CompositionLocalProvider(
LocalGradientColors provides gradientColors,
LocalBackgroundTheme provides backgroundTheme,
) {
ProvidePophoryColorAndTypography(colors, typography) {
MaterialTheme(content = content)
}
}
}