Skip to content

Commit cf3e96a

Browse files
authored
Merge pull request #1 from kalinjul/update-compose
update compose to 1.9.0
2 parents acd3b4a + 76ef5fa commit cf3e96a

8 files changed

Lines changed: 25 additions & 69 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ Supported Compose version:
1414
|-----------------|--------------------------|
1515
| 1.7 | 0.1.0+ |
1616
| 1.8 | 0.2.0+ |
17+
| 1.9 | 0.3.0+ |
1718

1819
# Dependency
1920
Add the dependency to your commonMain sourceSet (KMP) / Android dependencies (android only):
2021
```kotlin
21-
implementation("io.github.kalinjul.easydocumentscan:documentscanner:0.2.0")
22+
implementation("io.github.kalinjul.easydocumentscan:documentscanner:0.3.0")
2223
```
2324

2425
Or, for your libs.versions.toml:
2526
```toml
2627
[versions]
27-
easydocumentscan = "0.2.0"
28+
easydocumentscan = "0.3.0"
2829
[libraries]
2930
easydocumentscan = { module = "io.github.kalinjul.easydocumentscan:documentscanner", version.ref = "easydocumentscan" }
3031
```

build-logic/convention/src/main/kotlin/io/github/kalinjul/convention/KotlinMultiplatformMobileConventionPlugin.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import org.gradle.api.Plugin
44
import org.gradle.api.Project
55
import org.gradle.kotlin.dsl.configure
66
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
7-
import io.github.kalinjul.convention.config.configureAndroidTarget
87
import io.github.kalinjul.convention.config.configureKotlin
8+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
99

1010
/**
1111
* No JVM target, only android + ios
@@ -21,7 +21,11 @@ class KotlinMultiplatformMobileConventionPlugin : Plugin<Project> {
2121
applyDefaultHierarchyTemplate()
2222

2323
if (pluginManager.hasPlugin("com.android.library")) {
24-
this.configureAndroidTarget()
24+
androidTarget {
25+
compilerOptions {
26+
jvmTarget.set(JvmTarget.fromTarget((libs.versions.jvmTarget.get())))
27+
}
28+
}
2529
}
2630
}
2731
configureKotlin()

build-logic/convention/src/main/kotlin/io/github/kalinjul/convention/config/Kotlin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fun Project.configureKotlin() {
99
extensions.configure<KotlinMultiplatformExtension> {
1010
targets.all {
1111
compilations.all {
12-
compilerOptions.configure {
13-
freeCompilerArgs.add("-Xexpect-actual-classes")
12+
compileTaskProvider.configure {
13+
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
1414
}
1515
}
1616
}

build-logic/convention/src/main/kotlin/io/github/kalinjul/convention/config/Multiplatform.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
package io.github.kalinjul.convention.config
22

3-
import org.gradle.api.JavaVersion
43
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
5-
import io.github.kalinjul.convention.libs
6-
7-
fun KotlinMultiplatformExtension.configureAndroidTarget() {
8-
androidTarget {
9-
compilations.all {
10-
kotlinOptions {
11-
jvmTarget = JavaVersion.toVersion(project.libs.versions.jvmTarget.get()).toString()
12-
}
13-
}
14-
}
15-
}
164

175
fun KotlinMultiplatformExtension.configureIosTargets(baseName: String? = null) {
186
listOf(

documentscanner/src/iosMain/kotlin/io/github/kalinjul/easydocumentscan/DocumentScanner.ios.kt

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import androidx.compose.runtime.getValue
55
import androidx.compose.runtime.mutableStateOf
66
import androidx.compose.runtime.remember
77
import androidx.compose.runtime.setValue
8-
import androidx.compose.ui.interop.LocalUIViewController
8+
import androidx.compose.ui.uikit.LocalUIViewController
99
import platform.AVFoundation.AVErrorApplicationIsNotAuthorizedToUseDevice
1010
import platform.UIKit.UIButton
1111
import platform.UIKit.UIControlEventTouchUpInside
@@ -61,39 +61,13 @@ actual fun rememberDocumentScanner(
6161
}
6262

6363
private fun VNDocumentCameraViewController.setManualMode() {
64-
// val buttons = controller.view.findChildren { it is UIButton }
65-
// buttons.forEach {
66-
// println("${it.accessibilityLabel} ${it}")
67-
// it.findChildren { true }.forEach {
68-
// if (it is UILabel) {
69-
// println(" ${it.text} ${it.accessibilityLabel} $it")
70-
// if (it.text == "Auto") {
71-
// println("Found Auto button")
72-
// }
73-
// }
74-
// }
75-
// }
76-
7764
val autoButton = view.findChild {
7865
it.hasChild {
7966
val text = (it as? UILabel)?.text
8067
text == "Auto" || text == "Automatisch"
8168
} != null
8269
}
8370
(autoButton as? UIButton)?.sendActionsForControlEvents(UIControlEventTouchUpInside)
84-
85-
// var view = autoButton
86-
// println("View hierarchy:")
87-
// while(view != null) {
88-
// println(view)
89-
// view = view.superview
90-
// }
91-
92-
// val navigationbar = navigationController?.navigationBar
93-
// println("Navigationbar: $navigationbar")
94-
// buttons.find { it.accessibilityLabel?.contains("Filtereinstellungen") == true }?.removeFromSuperview()
95-
// val imageViews = controller.view.findChildren { it is UIImageView }
96-
// imageViews.forEach { it.removeFromSuperview() }
9771
}
9872
}
9973
}

gradle/libs.versions.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
[versions]
2-
compileSdk = "35"
3-
targetSdk = "35"
2+
compileSdk = "36"
3+
targetSdk = "36"
44
minSdk = "24" # required for exif interface
55

66
jvmTarget = "17"
77
# https://developer.android.com/build/releases/gradle-plugin#compatibility
8-
agp = "8.7.3"
8+
agp = "8.11.1"
99

1010
#https://github.com/JetBrains/compose-multiplatform
11-
compose-multiplatform = "1.8.0"
11+
compose-multiplatform = "1.9.0"
1212
#https://kotlinlang.org/docs/multiplatform-compatibility-guide.html
13-
kotlin = "2.1.20"
13+
kotlin = "2.2.20"
1414
# https://github.com/google/ksp
15-
ksp = "2.1.20-1.0.32"
15+
ksp = "2.2.20-2.0.3"
1616

1717
# https://developer.android.com/jetpack/androidx/releases/activity
18-
androidxActivity = "1.10.1"
18+
androidxActivity = "1.11.0"
1919
# https://developer.android.com/jetpack/androidx/releases/appcompat
20-
androidxAppCompat = "1.7.0"
21-
coreKtx = "1.16.0"
20+
androidxAppCompat = "1.7.1"
21+
coreKtx = "1.17.0"
2222

2323
dokka = "1.9.20"
24-
nexus-publish-plugin = "1.3.0"
24+
nexus-publish-plugin = "2.0.0"
2525
mlkit-document-scanner = "16.0.0-beta1"
2626

2727
[libraries]

sample-app/android-app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
kotlin {
88
androidTarget()
99
sourceSets {
10-
val androidMain by getting {
10+
androidMain {
1111
dependencies {
1212
implementation(libs.androidx.activity.compose)
1313
implementation(libs.androidx.core.ktx)

sample-app/shared/build.gradle.kts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
kotlin {
1212
configureIosTargets()
1313
sourceSets {
14-
val commonMain by getting {
14+
commonMain {
1515
dependencies {
1616
implementation(compose.runtime)
1717
implementation(compose.foundation)
@@ -20,21 +20,10 @@ kotlin {
2020
implementation(projects.documentscanner)
2121
}
2222
}
23-
val androidMain by getting {
23+
androidMain {
2424
dependencies {
25-
// api(libs.androidx.activity.compose)
26-
// api(libs.androidx.core.ktx)
2725
}
2826
}
29-
val iosX64Main by getting
30-
val iosArm64Main by getting
31-
val iosSimulatorArm64Main by getting
32-
val iosMain by getting {
33-
dependsOn(commonMain)
34-
iosX64Main.dependsOn(this)
35-
iosArm64Main.dependsOn(this)
36-
iosSimulatorArm64Main.dependsOn(this)
37-
}
3827
}
3928

4029
targets.withType<KotlinNativeTarget>().configureEach {

0 commit comments

Comments
 (0)