Skip to content

Commit

Permalink
Update dependencies, remove moko-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
fflopsi committed Feb 14, 2024
1 parent eb63b25 commit f6eaccf
Show file tree
Hide file tree
Showing 25 changed files with 430 additions and 380 deletions.
10 changes: 5 additions & 5 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
kotlinCompilerExtensionVersion = "1.5.9"
}
packaging {
resources {
Expand All @@ -61,13 +61,13 @@ android {
}

dependencies {
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(project(":common"))

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.0")
debugImplementation("androidx.compose.ui:ui-tooling:1.5.0")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.0")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.6.1")
debugImplementation("androidx.compose.ui:ui-tooling:1.6.1")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.6.1")
}
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ plugins {
id("com.android.library") apply false
id("org.jetbrains.kotlin.android") apply false
id("org.jetbrains.compose") apply false
id("dev.icerock.mobile.multiplatform-resources") apply false
}
31 changes: 14 additions & 17 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
id("dev.icerock.mobile.multiplatform-resources")
id("kotlin-kapt")
id("kotlin-parcelize")
}

kotlin {
jvmToolchain((property("tournamentscompose.versions.java") as String).toInt())
android()
androidTarget()
jvm()
sourceSets {
val decomposeVersion = "2.0.1"
val decomposeVersion = "2.2.2"
commonMain {
dependencies {
implementation(compose.runtime)
Expand All @@ -22,37 +21,33 @@ kotlin {
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(
compose.components.resources
)
val resourcesVersion = "0.23.0"
implementation("dev.icerock.moko:resources:$resourcesVersion")
implementation("dev.icerock.moko:resources-compose:$resourcesVersion")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.arkivanov.decompose:decompose:$decomposeVersion")
implementation("com.arkivanov.decompose:extensions-compose-jetbrains:$decomposeVersion")
}
}
val androidMain by getting {
dependencies {
val composeBom = platform("androidx.compose:compose-bom:2023.08.00")
implementation(composeBom)
implementation(project.dependencies.platform("androidx.compose:compose-bom:2024.02.00"))
implementation("androidx.compose.ui:ui")
//implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.runtime:runtime-livedata")
implementation("androidx.compose.material3:material3")

implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
implementation("androidx.navigation:navigation-compose:2.7.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
implementation("androidx.navigation:navigation-compose:2.7.7")

val roomVersion = "2.5.2"
val roomVersion = "2.6.1"
implementation("androidx.room:room-runtime:$roomVersion")
implementation("androidx.room:room-ktx:$roomVersion")
//annotationProcessor("androidx.room:room-compiler:$roomVersion")
configurations["kapt"].dependencies.add(project.dependencies.create("androidx.room:room-compiler:$roomVersion"))

implementation("com.google.accompanist:accompanist-systemuicontroller:0.30.1")
implementation("com.arkivanov.decompose:decompose:$decomposeVersion")
implementation("com.arkivanov.decompose:extensions-compose-jetbrains:$decomposeVersion")
// implementation("com.arkivanov.decompose:decompose:$decomposeVersion")
// implementation("com.arkivanov.decompose:extensions-compose-jetbrains:$decomposeVersion")
}
}
val jvmMain by getting {
Expand All @@ -63,14 +58,16 @@ kotlin {
val multiplatformSettingsVersion = "1.0.0"
implementation("com.russhwolf:multiplatform-settings:$multiplatformSettingsVersion")
implementation("com.russhwolf:multiplatform-settings-coroutines:$multiplatformSettingsVersion")
// implementation("com.arkivanov.decompose:decompose:$decomposeVersion")
// implementation("com.arkivanov.decompose:extensions-compose-jetbrains:$decomposeVersion")
}
}
}
}

multiplatformResources {
multiplatformResourcesPackage = "me.frauenfelderflorian.tournamentscompose.common"
}
//multiplatformResources {
// multiplatformResourcesPackage = "me.frauenfelderflorian.tournamentscompose.common"
//}

android {
namespace = "me.frauenfelderflorian.tournamentscompose.common"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.room.Room
import com.arkivanov.decompose.defaultComponentContext
import com.arkivanov.decompose.router.stack.StackNavigation
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import dev.icerock.moko.resources.compose.stringResource
import kotlinx.coroutines.launch
import me.frauenfelderflorian.tournamentscompose.common.data.PlayersModel
import me.frauenfelderflorian.tournamentscompose.common.data.Prefs
import me.frauenfelderflorian.tournamentscompose.common.data.PrefsFactory
Expand All @@ -39,6 +39,9 @@ import me.frauenfelderflorian.tournamentscompose.common.ui.ProvideComponentConte
import me.frauenfelderflorian.tournamentscompose.common.ui.Screen
import me.frauenfelderflorian.tournamentscompose.common.ui.importFromUri
import me.frauenfelderflorian.tournamentscompose.common.ui.theme.TournamentsTheme
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.stringResource
import tournamentscompose.common.generated.resources.Res

fun androidApp(activity: ComponentActivity) {
WindowCompat.setDecorFitsSystemWindows(activity.window, false)
Expand All @@ -48,6 +51,7 @@ fun androidApp(activity: ComponentActivity) {
}
}

@OptIn(ExperimentalResourceApi::class)
@Composable
fun AndroidAppContent(intent: Intent) {
val context = LocalContext.current
Expand Down Expand Up @@ -97,29 +101,31 @@ fun AndroidAppContent(intent: Intent) {
showedImport = true
},
icon = { Icon(Icons.Default.ArrowDownward, null) },
title = { Text(stringResource(MR.strings.import_)) },
text = { Text(stringResource(MR.strings.import_info)) },
title = { Text(stringResource(Res.string.import)) },
text = { Text(stringResource(Res.string.import_info)) },
confirmButton = {
TextButton({
showImport = false
importFromUri(
uri = intent.data,
context = context,
scope = scope,
tournamentDao = tournamentDao,
gameDao = gameDao,
)
scope.launch {
importFromUri(
uri = intent.data,
context = context,
scope = scope,
tournamentDao = tournamentDao,
gameDao = gameDao,
)
}
showedImport = true
}) {
Text(stringResource(MR.strings.ok))
Text(stringResource(Res.string.ok))
}
},
dismissButton = {
TextButton({
showImport = false
showedImport = true
}) {
Text(stringResource(MR.strings.cancel))
Text(stringResource(Res.string.cancel))
}
},
)
Expand Down
Loading

0 comments on commit f6eaccf

Please sign in to comment.