Skip to content

Commit 981d123

Browse files
committed
update compose
1 parent 4f3c9b8 commit 981d123

File tree

10 files changed

+48
-44
lines changed

10 files changed

+48
-44
lines changed

buildSrc/src/main/java/com/netguru/multiplatform/charts/extensions/BaseAndroidSetup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fun Project.baseAndroidSetup() {
1313
if (project.plugins.hasPlugin("com.android.library")) {
1414
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
1515
}
16-
if (project.plugins.hasPlugin(libs.plugins.compose.get().pluginId)) {
16+
if (project.plugins.hasPlugin(libs.plugins.kotlin.compose.get().pluginId)) {
1717
buildFeatures.compose = true
1818
}
1919
defaultConfig {

charts/build.gradle.kts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,29 @@ import com.netguru.multiplatform.charts.extensions.commonMain
33
import com.netguru.multiplatform.charts.extensions.commonTest
44
import com.netguru.multiplatform.charts.extensions.kotlin
55
import com.netguru.multiplatform.charts.extensions.sourceSets
6-
import org.jetbrains.compose.compose
76
import java.net.URL
87

98
baseAndroidSetup()
109

1110
plugins {
12-
alias(libs.plugins.compose)
11+
alias(libs.plugins.kotlin.compose)
1312
kotlin("multiplatform")
1413
id("com.android.library")
1514
alias(libs.plugins.dokka)
1615
}
1716

1817
kotlin {
19-
android()
18+
androidTarget()
2019
jvm("desktop")
2120

2221
sourceSets {
2322
commonMain {
2423
dependencies {
25-
api(compose.runtime)
26-
api(compose.ui)
27-
api(compose.foundation)
28-
api(compose.material)
29-
api(compose.materialIconsExtended)
24+
api(libs.compose.runtime)
25+
api(libs.compose.ui)
26+
api(libs.compose.foundation)
27+
api(libs.compose.material)
28+
api(libs.compose.materialIconsExtended)
3029
}
3130
}
3231
commonTest {
@@ -36,6 +35,9 @@ kotlin {
3635
}
3736
}
3837
}
38+
android {
39+
namespace = "com.netguru.multiplatform.charts"
40+
}
3941

4042
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
4143
dokkaSourceSets {

charts/src/commonMain/kotlin/com/netguru/multiplatform/charts/line/ChartLegend.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package com.netguru.multiplatform.charts.line
22

33
import androidx.compose.animation.core.animateFloatAsState
4-
import androidx.compose.foundation.ExperimentalFoundationApi
54
import androidx.compose.foundation.layout.Box
65
import androidx.compose.foundation.layout.PaddingValues
76
import androidx.compose.foundation.layout.Row
87
import androidx.compose.foundation.layout.Spacer
98
import androidx.compose.foundation.layout.size
109
import androidx.compose.foundation.layout.width
11-
import androidx.compose.foundation.lazy.GridCells
12-
import androidx.compose.foundation.lazy.LazyVerticalGrid
10+
import androidx.compose.foundation.lazy.grid.GridCells
11+
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
1312
import androidx.compose.runtime.Composable
1413
import androidx.compose.runtime.Immutable
1514
import androidx.compose.runtime.LaunchedEffect
@@ -30,7 +29,6 @@ import com.netguru.multiplatform.charts.ChartAnimation
3029
import com.netguru.multiplatform.charts.bar.BarChartConfig
3130
import com.netguru.multiplatform.charts.grid.GridDefaults
3231

33-
@OptIn(ExperimentalFoundationApi::class)
3432
@Composable
3533
fun ChartLegend(
3634
legendData: List<LegendItemData>,
@@ -41,7 +39,7 @@ fun ChartLegend(
4139
) {
4240
LazyVerticalGrid(
4341
modifier = modifier,
44-
cells = GridCells.Adaptive(200.dp),
42+
columns = GridCells.Adaptive(200.dp),
4543
contentPadding = PaddingValues(
4644
start = 12.dp,
4745
top = 16.dp,

charts/src/commonMain/kotlin/com/netguru/multiplatform/charts/pie/PieChartLegend.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import androidx.compose.foundation.layout.Box
88
import androidx.compose.foundation.layout.Column
99
import androidx.compose.foundation.layout.Row
1010
import androidx.compose.foundation.layout.size
11-
import androidx.compose.foundation.lazy.GridCells
12-
import androidx.compose.foundation.lazy.LazyVerticalGrid
11+
import androidx.compose.foundation.lazy.grid.GridCells
12+
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
1313
import androidx.compose.runtime.Composable
1414
import androidx.compose.runtime.LaunchedEffect
1515
import androidx.compose.runtime.getValue
@@ -65,7 +65,7 @@ internal fun PieChartLegend(
6565
LazyVerticalGrid(
6666
horizontalArrangement = Arrangement.SpaceAround,
6767
verticalArrangement = Arrangement.SpaceAround,
68-
cells = GridCells.Fixed(columnsPerRow),
68+
columns = GridCells.Fixed(columnsPerRow),
6969
content = {
7070
items(data.count()) { index ->
7171
LegendItem(

example-app/android/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ baseAndroidSetup()
55
plugins {
66
kotlin("android")
77
@Suppress("DSL_SCOPE_VIOLATION")
8-
alias(libs.plugins.compose)
8+
alias(libs.plugins.kotlin.compose)
99
id("com.android.application")
1010
id("shot")
1111
}
@@ -15,8 +15,8 @@ version = libs.versions.project.version.get()
1515

1616
dependencies {
1717
implementation(libs.androidx.compose)
18-
debugImplementation(compose.uiTooling)
19-
implementation(compose.preview)
18+
debugImplementation(libs.compose.uiTooling)
19+
implementation(libs.compose.preview)
2020
implementation(libs.androidx.window)
2121
implementation(project(":example-app:application"))
2222
androidTestImplementation(libs.test.junit)
@@ -41,6 +41,7 @@ android {
4141
"META-INF/LGPL2.1"
4242
)
4343
}
44+
namespace = "com.netguru.multiplatform.charts.android"
4445
}
4546

4647
shot {

example-app/application/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import com.netguru.multiplatform.charts.extensions.androidMain
22
import com.netguru.multiplatform.charts.extensions.baseAndroidSetup
33
import com.netguru.multiplatform.charts.extensions.baseTestSetup
44
import com.netguru.multiplatform.charts.extensions.commonMain
5-
import org.jetbrains.compose.compose
65

76
baseAndroidSetup()
87
baseTestSetup()
@@ -11,11 +10,11 @@ plugins {
1110
kotlin("multiplatform")
1211
id("com.android.library")
1312
@Suppress("DSL_SCOPE_VIOLATION")
14-
alias(libs.plugins.compose)
13+
alias(libs.plugins.kotlin.compose)
1514
}
1615

1716
kotlin {
18-
android()
17+
androidTarget()
1918
jvm("desktop")
2019

2120
sourceSets {
@@ -26,8 +25,11 @@ kotlin {
2625
}
2726
androidMain {
2827
dependencies {
29-
api(compose.uiTooling)
28+
api(libs.compose.uiTooling)
3029
}
3130
}
3231
}
3332
}
33+
android {
34+
namespace = "com.netguru.multiplatform.charts.application"
35+
}

example-app/application/src/commonMain/kotlin/com/netguru/multiplatform/charts/application/screen/GasBottleScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import androidx.compose.foundation.layout.fillMaxHeight
1111
import androidx.compose.foundation.layout.fillMaxWidth
1212
import androidx.compose.foundation.layout.padding
1313
import androidx.compose.foundation.layout.size
14-
import androidx.compose.foundation.lazy.GridCells
15-
import androidx.compose.foundation.lazy.GridItemSpan
16-
import androidx.compose.foundation.lazy.LazyVerticalGrid
14+
import androidx.compose.foundation.lazy.grid.GridCells
15+
import androidx.compose.foundation.lazy.grid.GridItemSpan
16+
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
1717
import androidx.compose.material.Text
1818
import androidx.compose.runtime.Composable
1919
import androidx.compose.ui.Alignment
@@ -51,7 +51,7 @@ fun GasBottleChartScreen() {
5151
modifier = Modifier
5252
.fillMaxHeight()
5353
.fillMaxWidth(),
54-
cells = GridCells.Fixed(numberOfCols),
54+
columns = GridCells.Fixed(numberOfCols),
5555
contentPadding = PaddingValues(AppTheme.dimens.grid_4),
5656
) {
5757
item(span = { GridItemSpan(numberOfCols) }) {

example-app/common/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@ import com.netguru.multiplatform.charts.extensions.baseAndroidSetup
33
import com.netguru.multiplatform.charts.extensions.baseTestSetup
44
import com.netguru.multiplatform.charts.extensions.sourceSets
55
import org.gradle.kotlin.dsl.kotlin
6-
import org.jetbrains.compose.compose
76

87
baseAndroidSetup()
98
baseTestSetup()
109

1110
plugins {
1211
kotlin("multiplatform")
1312
@Suppress("DSL_SCOPE_VIOLATION")
14-
alias(libs.plugins.compose)
13+
alias(libs.plugins.kotlin.compose)
1514
id("com.android.library")
1615
}
1716

1817
kotlin {
19-
android()
18+
androidTarget()
2019
jvm("desktop")
2120

2221
sourceSets {
2322
commonMain {
2423
kotlin.srcDir("${buildDir.absolutePath}/generated/resources")
2524
dependencies {
26-
api(compose.runtime)
27-
api(compose.ui)
28-
api(compose.foundation)
29-
api(compose.material)
30-
api(compose.materialIconsExtended)
25+
api(libs.compose.runtime)
26+
api(libs.compose.ui)
27+
api(libs.compose.foundation)
28+
api(libs.compose.material)
29+
api(libs.compose.materialIconsExtended)
3130
api(libs.time.klock)
3231
api(project(":charts"))
3332
}
@@ -45,6 +44,7 @@ android {
4544
sourceSets["main"].apply {
4645
res.srcDirs("src/androidMain/res", "src/commonMain/resources")
4746
}
47+
namespace = "com.netguru.multiplatform.charts.common"
4848
}
4949

5050
project.rootProject.tasks.apply {

example-app/desktop/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import com.netguru.multiplatform.charts.extensions.jvmMain
2-
import org.jetbrains.compose.compose
32
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
43

54
plugins {
65
kotlin("multiplatform")
76
@Suppress("DSL_SCOPE_VIOLATION")
8-
alias(libs.plugins.compose)
7+
alias(libs.plugins.kotlin.compose)
8+
alias(libs.plugins.compose.desktop)
99
}
1010

1111
group = libs.versions.project.group.get()

gradle/libs.versions.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
## SDK Versions
3-
compileSdk = "31"
3+
compileSdk = "35"
44
minSdk = "24"
55
targetSdk = "31"
66
versionCode = "1"
@@ -19,11 +19,12 @@ desktop-packageName = "jvm"
1919
# Dependencies
2020
kotlin-gradle-plugin = "2.1.10"
2121
android-gradle-plugin = "8.7.3"
22-
compose = "1.1.1"
23-
activity-compose = "1.4.0"
24-
coroutines = "1.6.0"
25-
appcompat = "1.4.1"
26-
core-ktx = "1.7.0"
22+
jetbrains-compose = "1.7.3"
23+
activity-compose = "1.10.1"
24+
compose-test = "1.7.8"
25+
coroutines = "1.10.2"
26+
appcompat = "1.7.0"
27+
core-ktx = "1.16.0"
2728
junit = "4.13.2"
2829
window = "1.0.0"
2930
coroutines-test = "1.6.0"

0 commit comments

Comments
 (0)