Skip to content

Commit 5a79bbe

Browse files
committed
feat: Use material expressive theme, add networking libraries
1 parent 44a2a45 commit 5a79bbe

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

composeApp/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ kotlin {
3333
commonMain.dependencies {
3434
implementation(compose.runtime)
3535
implementation(compose.foundation)
36-
implementation("org.jetbrains.compose.material3:material3:1.9.0-beta06")
37-
implementation("org.jetbrains.compose.material3:material3-window-size-class:1.9.0-beta06")
36+
implementation(compose.material3)
37+
implementation(libs.compose.material3.windowsizeclass)
38+
implementation(libs.coil.kt)
39+
implementation(libs.coil.kt.ktor)
3840
implementation(compose.ui)
3941
implementation(compose.components.resources)
4042
implementation(compose.components.uiToolingPreview)

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/NavigationItem.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import androidx.compose.foundation.layout.Box
66
import androidx.compose.foundation.layout.height
77
import androidx.compose.foundation.layout.width
88
import androidx.compose.material3.*
9+
import androidx.compose.material3.MaterialTheme.motionScheme
910
import androidx.compose.runtime.Composable
1011
import androidx.compose.runtime.getValue
1112
import androidx.compose.ui.Alignment
1213
import androidx.compose.ui.Modifier
1314
import androidx.compose.ui.unit.dp
1415

16+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
1517
@Composable
1618
fun NavigationItem(
1719
selected: Boolean,
@@ -24,7 +26,7 @@ fun NavigationItem(
2426
colors: NavigationItemColors = WideNavigationRailItemDefaults.colors(),
2527
interactionSource: MutableInteractionSource? = null
2628
) {
27-
val lineWidth by animateDpAsState(if (selected) 64.dp else 32.dp)
29+
val lineWidth by animateDpAsState(if (selected) 64.dp else 32.dp, motionScheme.fastSpatialSpec())
2830

2931
WideNavigationRailItem(
3032
selected = selected,

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/theme/Theme.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.nsh07.nsh07.ui.theme
22
import androidx.compose.foundation.isSystemInDarkTheme
3-
import androidx.compose.material3.MaterialTheme
3+
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
4+
import androidx.compose.material3.MaterialExpressiveTheme
45
import androidx.compose.material3.darkColorScheme
56
import androidx.compose.material3.lightColorScheme
67
import androidx.compose.runtime.Composable
@@ -81,6 +82,7 @@ private val darkScheme = darkColorScheme(
8182
surfaceContainerHighest = surfaceContainerHighestDark,
8283
)
8384

85+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
8486
@Composable
8587
fun Nsh07Theme(
8688
darkTheme: Boolean = isSystemInDarkTheme(),
@@ -91,7 +93,7 @@ fun Nsh07Theme(
9193
else -> lightScheme
9294
}
9395

94-
MaterialTheme(
96+
MaterialExpressiveTheme(
9597
colorScheme = colorScheme,
9698
typography = AppTypography(),
9799
content = content

gradle/libs.versions.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
[versions]
22
androidx-lifecycle = "2.9.4"
33
composeMultiplatform = "1.10.0-alpha01"
4-
junit = "4.13.2"
54
kotlin = "2.2.20"
5+
coil3 = "3.3.0"
66

77
[libraries]
8-
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
9-
kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
10-
junit = { module = "junit:junit", version.ref = "junit" }
11-
androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
128
androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
9+
androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
10+
coil-kt = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil3" }
11+
coil-kt-ktor = { module = "io.coil-kt.coil3:coil-network-ktor3", version.ref = "coil3" }
12+
compose-material3-windowsizeclass = { module = "org.jetbrains.compose.material3:material3-window-size-class", version.ref = "composeMultiplatform" }
13+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
1314

1415
[plugins]
15-
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
1616
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
17+
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
1718
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

kotlin-js-store/wasm/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@
66
version "3.2.0"
77
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
88
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==
9+
10+
11+
version "8.18.0"
12+
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
13+
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==

0 commit comments

Comments
 (0)