From 26cf6c7861dedd26975fdf4c7afb6d0c1501f757 Mon Sep 17 00:00:00 2001 From: DatLag Date: Thu, 10 Oct 2024 13:41:50 +0200 Subject: [PATCH] updated some dependencies --- .../src/androidMain/AndroidManifest.xml | 7 +++ .../screen/home/dialog/about/AboutDialog.kt | 2 +- .../home/dialog/settings/SettingsDialog.kt | 2 +- gradle/libs.versions.toml | 28 +++++----- model/build.gradle.kts | 23 ++++++++ .../core/update/IUpdateCheckCallback.aidl | 7 +++ .../mimasu/core/update/IUpdateInfo.aidl | 11 ++++ .../mimasu/core/update/IUpdateService.aidl | 8 +++ .../model/common/ExtendAny.android.kt | 8 +++ .../model/common/MimasuUpdateService.kt | 55 +++++++++++++++++++ 10 files changed, 136 insertions(+), 15 deletions(-) create mode 100644 model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateCheckCallback.aidl create mode 100644 model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateInfo.aidl create mode 100644 model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateService.aidl create mode 100644 model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/ExtendAny.android.kt create mode 100644 model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/MimasuUpdateService.kt diff --git a/composeApp/src/androidMain/AndroidManifest.xml b/composeApp/src/androidMain/AndroidManifest.xml index d39aa67c..801a7e09 100644 --- a/composeApp/src/androidMain/AndroidManifest.xml +++ b/composeApp/src/androidMain/AndroidManifest.xml @@ -122,6 +122,13 @@ android:exported="true" android:readPermission="dev.datlag.burningseries.READ_DATABASE" android:grantUriPermissions="true" /> + + + + + + \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/about/AboutDialog.kt b/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/about/AboutDialog.kt index 7498ace4..83ec96dd 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/about/AboutDialog.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/about/AboutDialog.kt @@ -55,7 +55,7 @@ fun AboutDialog(component: AboutComponent) { ModalBottomSheet( onDismissRequest = component::dismiss, - windowInsets = insets, + contentWindowInsets = { insets }, sheetState = sheetState ) { val libs by produceState(null) { diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/settings/SettingsDialog.kt b/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/settings/SettingsDialog.kt index 89f972f2..045bc7d2 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/settings/SettingsDialog.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/burningseries/ui/navigation/screen/home/dialog/settings/SettingsDialog.kt @@ -46,7 +46,7 @@ fun SettingsDialog(component: SettingsComponent) { ModalBottomSheet( onDismissRequest = component::dismiss, - windowInsets = insets, + contentWindowInsets = { insets }, sheetState = sheetState ) { val userState by component.user.collectAsStateWithLifecycle(null) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ff837971..58da97ad 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,21 +2,21 @@ app = "6.0.0" aboutlibraries = "11.2.2" ackpine = "0.7.1" -activity = "1.9.1" +activity = "1.9.2" android = "8.5.1" android-core = "1.13.1" android-sqlite = "2.4.0" apollo = "4.0.0-beta.7" atomicfu = "0.25.0" blurhash = "0.3.0" -coil = "3.0.0-alpha09" -compose = "1.6.11" -coroutines = "1.8.1" +coil = "3.0.0-rc01" +compose = "1.7.0-rc01" +coroutines = "1.9.0" crashlytics-plugin = "3.0.2" datastore = "1.1.1" -datetime = "0.6.0" +datetime = "0.6.1" decompose = "3.1.0" -desugar = "2.0.4" +desugar = "2.1.2" firebase = "1.13.0" firebase-android = "21.0.0" firebase-android-analytics = "22.0.2" @@ -30,13 +30,13 @@ kast = "0.2.1" kmpalette = "3.1.0" kodein = "7.22.0" kolor = "1.7.0" -konfig = "0.15.1" -kotlin = "2.0.0" +konfig = "0.15.2" +kotlin = "2.0.20" ksoup = "0.1.2" -ksp = "2.0.0-1.0.23" +ksp = "2.0.20-1.0.25" ktor = "2.3.12" -ktorfit = "2.0.0" -media3 = "1.4.0" +ktorfit = "2.1.0" +media3 = "1.4.1" moko-resources = "0.24.1" multidex = "2.0.1" nanoid = "1.0.1" @@ -45,8 +45,9 @@ oidc = "0.10.0" okhttp = "4.12.0" osdetector = "1.7.3" qrose = "1.0.1" -sekret = "2.0.0-alpha-05" -serialization = "1.7.1" +sekret = "2.0.0-alpha-07" +serialization = "1.7.3" +service = "2.8.6" skeo = "0.2.1" sqldelight = "2.0.2" splashscreen = "1.0.1" @@ -128,6 +129,7 @@ sekret = { group = "dev.datlag.sekret", name = "sekret", version.ref = "sekret" serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "serialization" } serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } serialization-protobuf = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-protobuf", version.ref = "serialization" } +service = { group = "androidx.lifecycle", name = "lifecycle-service", version.ref = "service" } skeo = { group = "dev.datlag.skeo", name = "skeo", version.ref = "skeo" } sqldelight-coroutines = { group = "app.cash.sqldelight", name = "coroutines-extensions", version.ref = "sqldelight" } sqldelight-android = { group = "app.cash.sqldelight", name = "android-driver", version.ref = "sqldelight" } diff --git a/model/build.gradle.kts b/model/build.gradle.kts index 0985e4f1..f0636d6b 100644 --- a/model/build.gradle.kts +++ b/model/build.gradle.kts @@ -2,9 +2,11 @@ plugins { alias(libs.plugins.multiplatform) alias(libs.plugins.serialization) alias(libs.plugins.atomicfu) + alias(libs.plugins.android.library) } kotlin { + androidTarget() jvm() iosX64() @@ -34,5 +36,26 @@ kotlin { implementation(libs.coroutines) implementation(libs.tooling) } + + androidMain.dependencies { + implementation(libs.service) + } + } +} + +android { + compileSdk = 34 + namespace = "dev.datlag.burningseries.model" + sourceSets["main"].aidl.srcDirs("src/androidMain/aidl") + + defaultConfig { + minSdk = 23 + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_17 + } + buildFeatures { + aidl = true } } \ No newline at end of file diff --git a/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateCheckCallback.aidl b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateCheckCallback.aidl new file mode 100644 index 00000000..4e4e49e8 --- /dev/null +++ b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateCheckCallback.aidl @@ -0,0 +1,7 @@ +package dev.datlag.mimasu.core.update; + +import dev.datlag.mimasu.core.update.IUpdateInfo; + +interface IUpdateCheckCallback { + void onUpdateInfo(in IUpdateInfo updateInfo); +} \ No newline at end of file diff --git a/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateInfo.aidl b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateInfo.aidl new file mode 100644 index 00000000..a4521620 --- /dev/null +++ b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateInfo.aidl @@ -0,0 +1,11 @@ +package dev.datlag.mimasu.core.update; + +interface IUpdateInfo { + boolean available(); + + boolean required(); + + @nullable String playstore(); + + @nullable String directDownload(); +} \ No newline at end of file diff --git a/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateService.aidl b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateService.aidl new file mode 100644 index 00000000..3446940f --- /dev/null +++ b/model/src/androidMain/aidl/dev/datlag/mimasu/core/update/IUpdateService.aidl @@ -0,0 +1,8 @@ +// IUpdateService.aidl +package dev.datlag.mimasu.core.update; + +import dev.datlag.mimasu.core.update.IUpdateCheckCallback; + +interface IUpdateService { + void hasUpdate(in IUpdateCheckCallback callback); +} \ No newline at end of file diff --git a/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/ExtendAny.android.kt b/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/ExtendAny.android.kt new file mode 100644 index 00000000..da1f0446 --- /dev/null +++ b/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/ExtendAny.android.kt @@ -0,0 +1,8 @@ +package dev.datlag.burningseries.model.common + +import kotlin.reflect.KClass + +actual val KClass<*>.name: String + get() = this.qualifiedName?.ifBlank { null } + ?: this.simpleName?.ifBlank { null } + ?: this.java.canonicalName?.ifBlank { null } ?: this.java.name.ifBlank { null } ?: this.toString() \ No newline at end of file diff --git a/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/MimasuUpdateService.kt b/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/MimasuUpdateService.kt new file mode 100644 index 00000000..fe753c65 --- /dev/null +++ b/model/src/androidMain/kotlin/dev/datlag/burningseries/model/common/MimasuUpdateService.kt @@ -0,0 +1,55 @@ +package dev.datlag.burningseries.model.common + +import android.content.Intent +import android.os.IBinder +import androidx.lifecycle.LifecycleService +import androidx.lifecycle.lifecycleScope +import dev.datlag.mimasu.core.update.IUpdateCheckCallback +import dev.datlag.mimasu.core.update.IUpdateInfo +import dev.datlag.mimasu.core.update.IUpdateService +import kotlinx.coroutines.CoroutineScope + +class MimasuUpdateService : LifecycleService() { + + override fun onBind(intent: Intent): IBinder { + super.onBind(intent) + + return Binder(lifecycleScope) + } + + data class UpdateInfo( + val available: Boolean, + val required: Boolean, + val playStore: String? = null, + val directDownload: String? = null + ) : IUpdateInfo.Stub() { + override fun available(): Boolean { + return available + } + + override fun required(): Boolean { + return required + } + + override fun playstore(): String? { + return playStore + } + + override fun directDownload(): String? { + return directDownload + } + } + + class Binder( + val scope: CoroutineScope + ) : IUpdateService.Stub() { + override fun hasUpdate(callback: IUpdateCheckCallback?) { + callback?.onUpdateInfo( + UpdateInfo( + available = true, + required = true + ) + ) + } + } +} \ No newline at end of file