Skip to content

Commit 9f3bf6a

Browse files
authored
Merge pull request #160 from joreilly/dependency_updates
dependency updates
2 parents 62b2496 + a60c232 commit 9f3bf6a

File tree

5 files changed

+105
-4
lines changed

5 files changed

+105
-4
lines changed

composeApp/src/androidMain/kotlin/dev/johnoreilly/climatetrace/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable
1212
import cafe.adriel.voyager.navigator.Navigator
1313
import dev.johnoreilly.climatetrace.di.initKoin
1414
import dev.johnoreilly.climatetrace.ui.CountryListScreen
15+
import dev.johnoreilly.wordmaster.androidApp.theme.ClimateTraceTheme
1516

1617
class MainActivity : ComponentActivity() {
1718

@@ -22,7 +23,7 @@ class MainActivity : ComponentActivity() {
2223
initKoin(this)
2324

2425
setContent {
25-
MaterialTheme {
26+
ClimateTraceTheme {
2627
AndroidApp()
2728
}
2829
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package dev.johnoreilly.wordmaster.androidApp.theme
2+
3+
import androidx.compose.ui.graphics.Color
4+
5+
val Purple80 = Color(0xFFD0BCFF)
6+
val PurpleGrey80 = Color(0xFFCCC2DC)
7+
val Pink80 = Color(0xFFEFB8C8)
8+
9+
val Purple40 = Color(0xFF6650a4)
10+
val PurpleGrey40 = Color(0xFF625b71)
11+
val Pink40 = Color(0xFF7D5260)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package dev.johnoreilly.wordmaster.androidApp.theme
2+
3+
import android.os.Build
4+
import androidx.compose.foundation.isSystemInDarkTheme
5+
import androidx.compose.material3.MaterialTheme
6+
import androidx.compose.material3.darkColorScheme
7+
import androidx.compose.material3.dynamicDarkColorScheme
8+
import androidx.compose.material3.dynamicLightColorScheme
9+
import androidx.compose.material3.lightColorScheme
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.platform.LocalContext
12+
13+
private val DarkColorScheme = darkColorScheme(
14+
primary = Purple80,
15+
secondary = PurpleGrey80,
16+
tertiary = Pink80
17+
)
18+
19+
private val LightColorScheme = lightColorScheme(
20+
primary = Purple40,
21+
secondary = PurpleGrey40,
22+
tertiary = Pink40
23+
24+
/* Other default colors to override
25+
background = Color(0xFFFFFBFE),
26+
surface = Color(0xFFFFFBFE),
27+
onPrimary = Color.White,
28+
onSecondary = Color.White,
29+
onTertiary = Color.White,
30+
onBackground = Color(0xFF1C1B1F),
31+
onSurface = Color(0xFF1C1B1F),
32+
*/
33+
)
34+
35+
@Composable
36+
fun ClimateTraceTheme(
37+
darkTheme: Boolean = isSystemInDarkTheme(),
38+
// Dynamic color is available on Android 12+
39+
dynamicColor: Boolean = true,
40+
content: @Composable () -> Unit
41+
) {
42+
val colorScheme = when {
43+
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
44+
val context = LocalContext.current
45+
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
46+
}
47+
48+
darkTheme -> DarkColorScheme
49+
else -> LightColorScheme
50+
}
51+
52+
MaterialTheme(
53+
colorScheme = colorScheme,
54+
typography = Typography,
55+
content = content
56+
)
57+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package dev.johnoreilly.wordmaster.androidApp.theme
2+
3+
import androidx.compose.material3.Typography
4+
import androidx.compose.ui.text.TextStyle
5+
import androidx.compose.ui.text.font.FontFamily
6+
import androidx.compose.ui.text.font.FontWeight
7+
import androidx.compose.ui.unit.sp
8+
9+
// Set of Material typography styles to start with
10+
val Typography = Typography(
11+
bodyLarge = TextStyle(
12+
fontFamily = FontFamily.Default,
13+
fontWeight = FontWeight.Normal,
14+
fontSize = 16.sp,
15+
)
16+
/* Other default text styles to override
17+
titleLarge = TextStyle(
18+
fontFamily = FontFamily.Default,
19+
fontWeight = FontWeight.Normal,
20+
fontSize = 22.sp,
21+
lineHeight = 28.sp,
22+
letterSpacing = 0.sp
23+
),
24+
labelSmall = TextStyle(
25+
fontFamily = FontFamily.Default,
26+
fontWeight = FontWeight.Medium,
27+
fontSize = 11.sp,
28+
lineHeight = 16.sp,
29+
letterSpacing = 0.5.sp
30+
)
31+
*/
32+
)

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ksp = "2.2.0-2.0.2"
44
kotlinx-coroutines = "1.10.2"
55

66

7-
agp = "8.11.0"
7+
agp = "8.11.1"
88
android-compileSdk = "36"
99
android-minSdk = "24"
1010
android-targetSdk = "36"
@@ -19,11 +19,11 @@ koin-compose-multiplatform = "4.1.0"
1919
kmpNativeCoroutines = "1.0.0-ALPHA-45"
2020
kmpObservableViewModel = "1.0.0-BETA-12"
2121
kstore = "1.0.0"
22-
ktor = "3.2.1"
22+
ktor = "3.2.2"
2323
treemapChart = "0.1.3"
2424
voyager= "1.1.0-beta03"
2525
molecule = "2.1.0"
26-
mcp = "0.5.0"
26+
mcp = "0.6.0"
2727
shadowPlugin = "8.1.1"
2828

2929

0 commit comments

Comments
 (0)