Skip to content

Commit 12ca0b8

Browse files
authored
Merge pull request #29 from everymeals/feature/theme
[feature/theme] 앱 공통 테마 설정
2 parents 404d3b0 + 34c2412 commit 12ca0b8

File tree

5 files changed

+54
-69
lines changed

5 files changed

+54
-69
lines changed

presentation/src/main/java/com/everymeal/presentation/ui/theme/Color.kt

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ package com.everymeal.presentation.ui.theme
22

33
import androidx.compose.ui.graphics.Color
44

5-
val Purple80 = Color(0xFFD0BCFF)
6-
val PurpleGrey80 = Color(0xFFCCC2DC)
7-
val Pink80 = Color(0xFFEFB8C8)
8-
95
val Purple40 = Color(0xFF6650a4)
106
val PurpleGrey40 = Color(0xFF625b71)
117
val Pink40 = Color(0xFF7D5260)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.everymeal.presentation.ui.theme
2+
3+
import androidx.compose.ui.unit.dp
4+
5+
object Paddings{
6+
val none = 0.dp
7+
val xsmall = 2.dp
8+
val small = 4.dp
9+
val medium = 8.dp
10+
val large = 12.dp
11+
val xlarge = 16.dp
12+
val extra = 24.dp
13+
val xextra = 32.dp
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.everymeal.presentation.ui.theme
2+
3+
import androidx.compose.foundation.shape.RoundedCornerShape
4+
import androidx.compose.ui.unit.dp
5+
import androidx.compose.material3.Shapes
6+
7+
val Shapes = Shapes(
8+
small = RoundedCornerShape(4.dp),
9+
medium = RoundedCornerShape(8.dp),
10+
large = RoundedCornerShape(16.dp)
11+
)

presentation/src/main/java/com/everymeal/presentation/ui/theme/Theme.kt

+6-48
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,27 @@
11
package com.everymeal.presentation.ui.theme
22

3-
import android.app.Activity
4-
import android.os.Build
5-
import androidx.compose.foundation.isSystemInDarkTheme
63
import androidx.compose.material3.MaterialTheme
7-
import androidx.compose.material3.darkColorScheme
8-
import androidx.compose.material3.dynamicDarkColorScheme
9-
import androidx.compose.material3.dynamicLightColorScheme
104
import androidx.compose.material3.lightColorScheme
115
import androidx.compose.runtime.Composable
12-
import androidx.compose.runtime.SideEffect
13-
import androidx.compose.ui.graphics.toArgb
14-
import androidx.compose.ui.platform.LocalContext
15-
import androidx.compose.ui.platform.LocalView
16-
import androidx.core.view.WindowCompat
17-
18-
private val DarkColorScheme = darkColorScheme(
19-
primary = Purple80,
20-
secondary = PurpleGrey80,
21-
tertiary = Pink80
22-
)
6+
import androidx.compose.ui.graphics.Color
237

248
private val LightColorScheme = lightColorScheme(
259
primary = Purple40,
2610
secondary = PurpleGrey40,
27-
tertiary = Pink40
28-
29-
/* Other default colors to override
30-
background = Color(0xFFFFFBFE),
31-
surface = Color(0xFFFFFBFE),
32-
onPrimary = Color.White,
33-
onSecondary = Color.White,
34-
onTertiary = Color.White,
35-
onBackground = Color(0xFF1C1B1F),
36-
onSurface = Color(0xFF1C1B1F),
37-
*/
11+
tertiary = Pink40,
12+
background = Color.White,
13+
onBackground = Color.Black,
3814
)
3915

4016
@Composable
4117
fun EveryMeal_AndroidTheme(
42-
darkTheme: Boolean = isSystemInDarkTheme(),
43-
// Dynamic color is available on Android 12+
44-
dynamicColor: Boolean = true,
4518
content: @Composable () -> Unit
4619
) {
47-
val colorScheme = when {
48-
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
49-
val context = LocalContext.current
50-
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
51-
}
52-
53-
darkTheme -> DarkColorScheme
54-
else -> LightColorScheme
55-
}
56-
val view = LocalView.current
57-
if (!view.isInEditMode) {
58-
SideEffect {
59-
val window = (view.context as Activity).window
60-
window.statusBarColor = colorScheme.primary.toArgb()
61-
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
62-
}
63-
}
20+
val colorScheme = LightColorScheme
6421

6522
MaterialTheme(
6623
colorScheme = colorScheme,
24+
shapes = Shapes,
6725
typography = Typography,
6826
content = content
6927
)

presentation/src/main/java/com/everymeal/presentation/ui/theme/Type.kt

+23-17
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,35 @@ import androidx.compose.ui.text.font.FontFamily
66
import androidx.compose.ui.text.font.FontWeight
77
import androidx.compose.ui.unit.sp
88

9-
// Set of Material typography styles to start with
109
val Typography = Typography(
10+
titleLarge = TextStyle(
11+
fontFamily = FontFamily.Default,
12+
fontWeight = FontWeight.Bold,
13+
fontSize = 24.sp,
14+
),
15+
titleMedium = TextStyle(
16+
fontFamily = FontFamily.Default,
17+
fontWeight = FontWeight.Bold,
18+
fontSize = 20.sp,
19+
),
20+
titleSmall = TextStyle(
21+
fontFamily = FontFamily.Default,
22+
fontWeight = FontWeight.Bold,
23+
fontSize = 16.sp,
24+
),
1125
bodyLarge = TextStyle(
1226
fontFamily = FontFamily.Default,
1327
fontWeight = FontWeight.Normal,
14-
fontSize = 16.sp,
15-
lineHeight = 24.sp,
16-
letterSpacing = 0.5.sp
17-
)
18-
/* Other default text styles to override
19-
titleLarge = TextStyle(
28+
fontSize = 24.sp,
29+
),
30+
bodyMedium = TextStyle(
2031
fontFamily = FontFamily.Default,
2132
fontWeight = FontWeight.Normal,
22-
fontSize = 22.sp,
23-
lineHeight = 28.sp,
24-
letterSpacing = 0.sp
33+
fontSize = 20.sp,
2534
),
26-
labelSmall = TextStyle(
35+
bodySmall = TextStyle(
2736
fontFamily = FontFamily.Default,
28-
fontWeight = FontWeight.Medium,
29-
fontSize = 11.sp,
30-
lineHeight = 16.sp,
31-
letterSpacing = 0.5.sp
32-
)
33-
*/
37+
fontWeight = FontWeight.Normal,
38+
fontSize = 16.sp,
39+
),
3440
)

0 commit comments

Comments
 (0)