aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-22 00:28:07 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-22 00:28:07 -0600
commitdddc3d625e1c8be039c9cd31a448446d1e62e020 (patch)
treeeec516ebb09ba3cf315b9793f53545c6774278ce
parentd96d7e02e4530299ab3e5cb7bd97c9f58d76e634 (diff)
downloadetbsa-trackermap-mobile-dddc3d625e1c8be039c9cd31a448446d1e62e020.tar.gz
etbsa-trackermap-mobile-dddc3d625e1c8be039c9cd31a448446d1e62e020.tar.bz2
etbsa-trackermap-mobile-dddc3d625e1c8be039c9cd31a448446d1e62e020.zip
Prepare shared module for iOS support and updated appcompat and constraintlayout libraries
-rw-r--r--androidApp/build.gradle.kts4
-rw-r--r--shared/build.gradle.kts7
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt11
3 files changed, 13 insertions, 9 deletions
diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts
index 5347780..6920eb1 100644
--- a/androidApp/build.gradle.kts
+++ b/androidApp/build.gradle.kts
@@ -45,8 +45,8 @@ val googleImplementation by configurations
dependencies {
implementation(project(":shared"))
implementation("com.google.android.material:material:1.5.0")
- implementation("androidx.appcompat:appcompat:1.4.0")
- implementation("androidx.constraintlayout:constraintlayout:2.1.2")
+ implementation("androidx.appcompat:appcompat:1.4.1")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.3")
implementation("com.squareup.okhttp3:okhttp:4.9.1")
implementation("com.github.Zhuinden:live-event:1.2.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0")
diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
index 8832b1d..b8d36ff 100644
--- a/shared/build.gradle.kts
+++ b/shared/build.gradle.kts
@@ -24,7 +24,6 @@ kotlin {
val commonMain by getting {
dependencies {
implementation("io.ktor:ktor-client-core:$ktor_version")
- implementation("io.ktor:ktor-client-cio:$ktor_version")
implementation("io.ktor:ktor-client-logging:$ktor_version")
implementation("io.ktor:ktor-client-serialization:$ktor_version")
implementation("ch.qos.logback:logback-classic:1.2.6")
@@ -41,7 +40,11 @@ kotlin {
implementation(kotlin("test-annotations-common"))
}
}
- val androidMain by getting
+ val androidMain by getting {
+ dependencies {
+ implementation("io.ktor:ktor-client-cio:$ktor_version")
+ }
+ }
val androidTest by getting {
dependencies {
implementation(kotlin("test-junit"))
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
index 2ae2b2e..dd61893 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt
@@ -20,7 +20,7 @@ package mx.trackermap.TrackerMap.client.infrastructure
import com.russhwolf.settings.Settings
import io.ktor.client.*
import io.ktor.client.call.*
-import io.ktor.client.engine.cio.*
+import io.ktor.client.features.*
import io.ktor.client.features.json.*
import io.ktor.client.features.json.serializer.KotlinxSerializer
import io.ktor.client.features.logging.DEFAULT
@@ -47,7 +47,11 @@ open class ApiClient(
protected const val ApiFormURLType = "application/x-www-form-urlencoded"
protected const val ApiXmlMediaType = "application/xml"
- val client: HttpClient = HttpClient(CIO) {
+ val client: HttpClient = HttpClient {
+ install(HttpTimeout) {
+ connectTimeoutMillis = 20_000
+ requestTimeoutMillis = 20_000
+ }
install(JsonFeature) {
serializer = KotlinxSerializer(
KotlinJson {
@@ -59,9 +63,6 @@ open class ApiClient(
logger = Logger.DEFAULT
level = LogLevel.ALL
}
- engine {
- requestTimeout = 20_000
- }
}
val defaultHeaders: Map<String, String> =