Skip to content

Commit

Permalink
Merge pull request #29 from klippa-app/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
RobinFarmer authored Dec 16, 2024
2 parents 4cfaac4 + e49b899 commit 6b78186
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.0.4

* Bumped Android to 4.0.6
* Bumped iOS to 2.0.5
* Added `userShouldAcceptResultToContinue`.

## 1.0.3

* Bumped Android to 4.0.5
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ config.userCanPickMediaFromStorage = true;
// Whether the next button in the bottom right of the scanner screen goes to the review screen instead of finishing the session.
config.shouldGoToReviewScreenOnFinishPressed = true;
// Whether the user must confirm the taken photo before the SDK continues.
config.userShouldAcceptResultToContinue = false;
// What the default color conversion will be (grayscale, original, enhanced).
config.defaultColor = DefaultColor.original;
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ android {
}

dependencies {
def fallbackKlippaScannerVersion = "4.0.5"
def fallbackKlippaScannerVersion = "4.0.6"
def klippaScannerVersion = project.hasProperty('klippaScannerVersion') ? project.klippaScannerVersion : fallbackKlippaScannerVersion
implementation "com.klippa:scanner:$klippaScannerVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ class KlippaScannerSdkPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, P
scannerSession.menu.shouldGoToReviewScreenWhenImageLimitReached = it
}

call.argument<Boolean>("UserShouldAcceptResultToContinue")?.let {
scannerSession.menu.userShouldAcceptResultToContinue = it
}

call.argument<Boolean>("UserCanRotateImage")?.let {
scannerSession.menu.userCanRotateImage = it
}
Expand Down Expand Up @@ -284,6 +288,10 @@ class KlippaScannerSdkPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, P
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean {
if (requestCode != REQUEST_CODE) {
return false
}

val reason = ScannerFinishedReason.mapResultCode(resultCode)

when (reason) {
Expand Down
4 changes: 4 additions & 0 deletions ios/Classes/SwiftKlippaScannerSdkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ public class SwiftKlippaScannerSdkPlugin: NSObject, FlutterPlugin, KlippaScanner
builder.klippaMenu.shouldGoToReviewScreenWhenImageLimitReached = shouldGoToReviewScreenWhenImageLimitReached
}

if let userShouldAcceptResultToContinue = builderArgs?["UserShouldAcceptResultToContinue"] as? Bool {
builder.klippaMenu.userShouldAcceptResultToContinue = userShouldAcceptResultToContinue
}

if let userCanRotateImage = builderArgs?["UserCanRotateImage"] as? Bool {
builder.klippaMenu.userCanRotateImage = userCanRotateImage
}
Expand Down
2 changes: 1 addition & 1 deletion ios/sdk_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.4
2.0.5
8 changes: 8 additions & 0 deletions lib/klippa_scanner_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class CameraConfig {
/// Whether to go to the Review Screen once the image limit has been reached. (default false)
bool? shouldGoToReviewScreenWhenImageLimitReached;

/// Whether the user must confirm the taken photo before the SDK continues. (default false)
bool? userShouldAcceptResultToContinue;

/// Whether to hide or show the rotate button in the Review Screen. (default shown/true)
bool? userCanRotateImage;

Expand Down Expand Up @@ -485,6 +488,11 @@ class KlippaScannerSdk {
config.shouldGoToReviewScreenWhenImageLimitReached;
}

if (config.userShouldAcceptResultToContinue != null) {
parameters["UserShouldAcceptResultToContinue"] =
config.userShouldAcceptResultToContinue;
}

if (config.primaryColor != null) {
parameters["PrimaryColor"] =
KIVHexColor.flutterColorToHex(config.primaryColor!, true);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: klippa_scanner_sdk
description: Allows you to do document scanning with the Klippa Scanner SDK from Flutter apps.
version: 1.0.3
version: 1.0.4
homepage: https://github.com/klippa-app/flutter-klippa-scanner-sdk

environment:
Expand Down

0 comments on commit 6b78186

Please sign in to comment.