Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Supported Compose version:
# Dependency
Add the dependency to your commonMain sourceSet (KMP) / Android dependencies (android only):
```kotlin
implementation("io.github.kalinjul.easydocumentscan:documentscanner:0.3.0")
implementation("io.github.kalinjul.easydocumentscan:documentscanner:0.3.1")
```

Or, for your libs.versions.toml:
```toml
[versions]
easydocumentscan = "0.3.0"
easydocumentscan = "0.3.1"
[libraries]
easydocumentscan = { module = "io.github.kalinjul.easydocumentscan:documentscanner", version.ref = "easydocumentscan" }
easydocumentscan = { module = "io.github.kalinjul.easydocumentscan:documentscanner-compose", version.ref = "easydocumentscan" }
```

# Usage
Expand Down
43 changes: 43 additions & 0 deletions documentscanner-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@file:OptIn(ExperimentalWasmDsl::class)

import io.github.kalinjul.convention.config.configureIosTargets
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
id("io.github.kalinjul.convention.android.library")
id("io.github.kalinjul.convention.kotlin.multiplatform.mobile")
id("io.github.kalinjul.convention.centralPublish")
id("io.github.kalinjul.convention.compose.multiplatform")
}

description = "Compose Multiplatform Document Scanner for Android/iOS"

kotlin {
configureIosTargets()
jvm()
wasmJs() {
browser()
}

sourceSets {
commonMain {
dependencies {
api(projects.documentscannerCore)
implementation(compose.runtime)
implementation(compose.foundation)
}
}

androidMain {
dependencies {
implementation(libs.mlkit.documentscanner)
implementation(libs.androidx.activity.compose)
}
}

jvmMain {
dependencies {
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.kalinjul.easydocumentscan

@androidx.compose.runtime.Composable
actual fun rememberDocumentScanner(
onResult: (Result<List<KmpImage>>) -> Unit,
options: DocumentScannerOptions
): DocumentScanner {
return object: DocumentScanner {
override fun scan() {
println("Scanner not implemented for JVM")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@file:OptIn(ExperimentalWasmDsl::class)

import io.github.kalinjul.convention.config.configureIosTargets
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
id("io.github.kalinjul.convention.android.library")
Expand All @@ -12,6 +15,9 @@ description = "Compose Multiplatform Document Scanner for Android/iOS"
kotlin {
configureIosTargets()
jvm()
wasmJs() {
browser()
}

sourceSets {
commonMain {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.github.kalinjul.easydocumentscan

actual fun ByteArray.toImageBitmap(): androidx.compose.ui.graphics.ImageBitmap {
TODO("Not yet implemented")
}
2 changes: 1 addition & 1 deletion sample-app/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlin {
implementation(compose.foundation)
implementation(compose.material3)

implementation(projects.documentscanner)
implementation(projects.documentscannerCompose)
}
}
androidMain {
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ dependencyResolutionManagement {

rootProject.name="EasyDocumentScan"

include(":documentscanner")
include(":documentscanner-core")
include(":documentscanner-compose")
include(":sample-app:shared")
include(":sample-app:android-app")

Expand Down