Skip to content

Commit 697d600

Browse files
authored
Merge pull request #6 from kalinjul/update-compose
Update compose
2 parents 7b4953d + a79ff37 commit 697d600

4 files changed

Lines changed: 31 additions & 15 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ Supported Compose versions:
1414
| 0.1.0+ | 1.7 |
1515
| 0.2.0+ | 1.8 |
1616
| 0.3.0+ | 1.9 |
17+
| 0.4.0+ | 1.10 |
1718

1819
# Dependency
1920
> [!NOTE]
20-
> Artifact id changed from "documentscanner" to "documentscanner-compose" and a new "documentscanner-core" artifact was introduced with 0.3.2 that contains the KmpFile abstraction as well as some Helper functions.
21+
> Starting with 0.3.2, artifact id changed from "documentscanner" to "documentscanner-compose" and a new "documentscanner-core" artifact was introduced that contains the KmpFile abstraction as well as some Helper functions.
2122
2223
Add the dependency to your commonMain sourceSet (KMP) / Android dependencies (android only):
2324
```kotlin
24-
implementation("io.github.kalinjul.easydocumentscan:documentscanner-compose:0.3.2")
25+
implementation("io.github.kalinjul.easydocumentscan:documentscanner-compose:0.4.0")
2526
```
2627

2728
Or, for your libs.versions.toml:
2829
```toml
2930
[versions]
30-
easydocumentscanner = "0.3.2"
31+
easydocumentscanner = "0.4.0"
3132
[libraries]
3233
easydocumentscanner-compose = { module = "io.github.kalinjul.easydocumentscan:documentscanner-compose", version.ref = "easydocumentscanner" }
3334
easydocumentscanner-core = { module = "io.github.kalinjul.easydocumentscan:documentscanner-core", version.ref = "easydocumentscanner" }

documentscanner-compose/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ kotlin {
2323
commonMain {
2424
dependencies {
2525
api(projects.documentscannerCore)
26-
implementation(compose.runtime)
27-
implementation(compose.foundation)
26+
implementation(libs.compose.runtime)
27+
implementation(libs.compose.foundation)
2828
}
2929
}
3030

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,24 @@ actual fun rememberDocumentScanner(
6161
}
6262

6363
private fun VNDocumentCameraViewController.setManualMode() {
64+
// iOS < 26
6465
val autoButton = view.findChild {
6566
it.hasChild {
6667
val text = (it as? UILabel)?.text
6768
text == "Auto" || text == "Automatisch"
6869
} != null
6970
}
7071
(autoButton as? UIButton)?.sendActionsForControlEvents(UIControlEventTouchUpInside)
72+
73+
// iOS 26
74+
val shutterButton = view.findChild {
75+
it.hasChild {
76+
val text = (it as? UILabel)?.text
77+
text == "Shutter" || text == "Verschluss"
78+
} != null
79+
}
80+
81+
(shutterButton?.subviews?.firstOrNull() as? UIButton)?.sendActionsForControlEvents(UIControlEventTouchUpInside)
7182
}
7283
}
7384
}
@@ -91,11 +102,11 @@ private fun UIView.findChildren(predicate: (UIView) -> Boolean): List<UIView> {
91102
private fun UIView.findChild(predicate: (UIView) -> Boolean): UIView? {
92103
subviews.forEach {
93104
val view:UIView? = it as? UIView
94-
when(view) {
95-
is UIButton -> println(view)
96-
is UILabel -> println(view.text)
97-
else -> println(view)
98-
}
105+
// when(view) {
106+
// is UIButton -> println(view)
107+
// is UILabel -> println(view.text)
108+
// else -> println(view)
109+
// }
99110

100111
if (view != null && predicate(view)) {
101112
return view

gradle/libs.versions.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ minSdk = "24" # required for exif interface
55

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

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

1717
# https://developer.android.com/jetpack/androidx/releases/activity
18-
androidxActivity = "1.11.0"
18+
androidxActivity = "1.12.4"
1919
# https://developer.android.com/jetpack/androidx/releases/appcompat
2020
androidxAppCompat = "1.7.1"
2121
coreKtx = "1.17.0"
@@ -30,6 +30,10 @@ androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "a
3030
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
3131
mlkit-documentscanner = { module = "com.google.android.gms:play-services-mlkit-document-scanner", version.ref = "mlkit-document-scanner" }
3232

33+
# compose
34+
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" }
35+
compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-multiplatform" }
36+
3337
# Build logic dependencies
3438
android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }
3539
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }

0 commit comments

Comments
 (0)