- Implement `NetworkModule` for HTTP client management with JSON serialization.
- Add `kotlinx-serialization-json` and `ktor-client` dependencies.
- Update `Greeting` class to perform network requests to fetch and display time data.
- Add `NetworkResponse` and `TimeResponse` data classes for handling the remote API response.
- Introduce `ScreenTime` interface for platform-specific screen time data.
- Implement `ScreenTime` for Linux and Android, with basic or placeholder logic.
- Add `INTERNET` and `ACCESS_NETWORK_STATE` permissions to Android's `AndroidManifest.xml`.
- Add `ScreenTime.native.kt`, `ScreenTime.jvm.kt` and `ScreenTime.android.kt` to separate platform-specific code.
- Implement `kotlin("plugin.serialization")` plugin in shared module.
- Update dependencies.
- Add `ignoreUnknownKeys` and `coerceInputValues` for JSON serialization.
- Update `App` to display time data from remote API.
47 lines
3.0 KiB
TOML
47 lines
3.0 KiB
TOML
[versions]
|
|
agp = "8.5.2"
|
|
android-compileSdk = "35"
|
|
android-minSdk = "24"
|
|
android-targetSdk = "35"
|
|
androidx-activityCompose = "1.10.1"
|
|
androidx-appcompat = "1.7.0"
|
|
androidx-constraintlayout = "2.2.1"
|
|
androidx-core-ktx = "1.16.0"
|
|
androidx-espresso-core = "3.6.1"
|
|
androidx-lifecycle = "2.8.4"
|
|
androidx-material = "1.12.0"
|
|
androidx-test-junit = "1.2.1"
|
|
compose-multiplatform = "1.7.3"
|
|
junit = "4.13.2"
|
|
kotlin = "2.1.20"
|
|
kotlinx-coroutines = "1.10.1"
|
|
kotlinxSerializationJson = "1.8.0"
|
|
ktorClientCore = "3.1.1"
|
|
|
|
[libraries]
|
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
|
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
|
|
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
|
|
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }
|
|
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
|
|
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }
|
|
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
|
|
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
|
|
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
|
|
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
|
|
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
|
|
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
|
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
|
|
ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktorClientCore" }
|
|
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktorClientCore" }
|
|
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorClientCore" }
|
|
ktor-client-ios = { module = "io.ktor:ktor-client-ios", version.ref = "ktorClientCore" }
|
|
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorClientCore" }
|
|
|
|
[plugins]
|
|
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
|
androidLibrary = { id = "com.android.library", version.ref = "agp" }
|
|
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
|
|
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } |