react-native-okaycam 1.1.27 → 1.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/android/build.gradle +14 -15
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/java/com/innov8tif/RNOkayCam/RNOkayCamModule.java +4 -2
- package/index.ts +159 -9
- package/ios/RNOkayCam.swift +2 -2
- package/package.json +6 -2
- package/react-native-okaycam.podspec +1 -1
- package/android/.DS_Store +0 -0
- package/android/.gradle/6.8/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/6.8/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/6.8/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/6.8/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/6.8/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1.1/gc.properties +0 -0
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/.gitignore +0 -3
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -20
- package/android/.idea/jarRepositories.xml +0 -45
- package/android/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_2_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_core_core_1_3_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_v4_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_media_media_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_caverock_androidsvg_aar_1_4_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -19
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3.xml +0 -13
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_googlecode_json_simple_json_simple_1_1_1.xml +0 -13
- package/android/.idea/libraries/Gradle__com_innov8tif_okaycam_OkayCam_1_1_10_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0.xml +0 -13
- package/android/.idea/libraries/Gradle__commons_cli_commons_cli_1_2.xml +0 -13
- package/android/.idea/libraries/Gradle__junit_junit_4_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_1.xml +0 -11
- package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_4_21.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_21.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_21.xml +0 -13
- package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -11
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -105
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/build/generated/source/buildConfig/debug/com/innov8tif/RNOkayCam/BuildConfig.java +0 -12
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -27
- package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotations_typedef_file/debug/typedefs.txt +0 -0
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -3230
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/innov8tif/RNOkayCam/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/innov8tif/RNOkayCam/RNOkayCamModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/innov8tif/RNOkayCam/RNOkayCamPackage.class +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -13
- package/android/build/intermediates/merged_java_res/debug/out.jar +0 -0
- package/android/build/intermediates/merged_manifests/debug/output.json +0 -27
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -2248
- package/android/build/outputs/aar/android-debug.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
- package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +0 -6
- package/android/local.properties +0 -8
- package/ios/RNOkayCam.xcodeproj/xcuserdata/thet.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/RNOkayCam.xcworkspace/xcuserdata/thet.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
package/README.md
CHANGED
|
@@ -92,9 +92,13 @@ const license = Platform.select({
|
|
|
92
92
|
|confirmBtnConfig|contentColor|content color of the confirm button|#ffffff|
|
|
93
93
|
|retakeBtnConfig|backgroundColor|background color of the retake button|#ffa500|
|
|
94
94
|
|retakeBtnConfig|contentColor|content color of the retake button|#ffffff|
|
|
95
|
+
|captureConfig|first|config for the first capture|delay:0s,onFlash:false,outputPath: null|
|
|
96
|
+
|captureConfig|second|config for the second capture|delay:5s,onFlash:true,outputPath: null|
|
|
97
|
+
|<sup>**New**</sup>captureConfig|first|config for the first capture|delay:0s,onFlash:false,outputPath:null,onImageQuality:false|
|
|
98
|
+
|<sup>**New**</sup>captureConfig|second|config for the second capture|delay:5s,onFlash:true,outputPath:null,onImageQuality:false|
|
|
95
99
|
|-|captureBtnColor|color of the capture button|#ffffff|
|
|
96
100
|
|-|firstPhotoConfig|config for the first capture|delay:0s,onFlash:false,outputPath: null|
|
|
97
|
-
|-|secondPhotoConfig|config for the second capture|null|
|
|
101
|
+
|-|secondPhotoConfig|config for the second capture|delay:5s,onFlash:false,outputPath: null|
|
|
98
102
|
|preview |title|title on preview screen|""(empty string)|
|
|
99
103
|
|preview |refImg|ref image on preview screen|null|
|
|
100
104
|
|preview |instruction1|instruction on preview screen|""(empty string)|
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
ext.kotlin_version = '1.4.21'
|
|
3
3
|
repositories {
|
|
4
|
+
google()
|
|
4
5
|
jcenter()
|
|
5
6
|
mavenCentral()
|
|
6
|
-
google()
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
dependencies {
|
|
@@ -14,12 +14,11 @@ buildscript {
|
|
|
14
14
|
apply plugin: 'com.android.library'
|
|
15
15
|
|
|
16
16
|
android {
|
|
17
|
-
compileSdkVersion
|
|
18
|
-
buildToolsVersion "23.0.3"
|
|
17
|
+
compileSdkVersion 33
|
|
19
18
|
|
|
20
19
|
defaultConfig {
|
|
21
20
|
minSdkVersion 21
|
|
22
|
-
targetSdkVersion
|
|
21
|
+
targetSdkVersion 33
|
|
23
22
|
versionCode 1
|
|
24
23
|
versionName "1.0"
|
|
25
24
|
}
|
|
@@ -30,28 +29,28 @@ android {
|
|
|
30
29
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
31
30
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
repositories {
|
|
35
|
-
// jcenter({ url "https://dl.bintray.com/innov8tifekyc/OkayCam/" })
|
|
36
|
-
// maven { url "https://s01.oss.sonatype.org/content/repositories/cominnov8tif-1064" }
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
32
|
}
|
|
41
33
|
|
|
42
34
|
repositories {
|
|
43
|
-
mavenCentral()
|
|
44
35
|
google()
|
|
36
|
+
mavenCentral()
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
dependencies {
|
|
48
|
-
implementation '
|
|
49
|
-
|
|
40
|
+
implementation ('org.pytorch:pytorch_android_lite:1.5.0'){
|
|
41
|
+
exclude module: 'fbjni-java-only'
|
|
42
|
+
}
|
|
43
|
+
implementation ('org.pytorch:pytorch_android_torchvision_lite:1.5.0'){
|
|
44
|
+
exclude module: 'fbjni-java-only'
|
|
45
|
+
}
|
|
46
|
+
implementation('com.facebook.react:react-native:+'){
|
|
47
|
+
exclude module: 'fbjni-java-only'
|
|
48
|
+
}
|
|
49
|
+
implementation('com.innov8tif.okaycam:OkayCam:0.0.3@aar') {
|
|
50
50
|
transitive = true
|
|
51
51
|
}
|
|
52
52
|
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
|
53
53
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
54
|
-
|
|
55
54
|
implementation 'com.caverock:androidsvg-aar:1.4'
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
6
6
|
|
package/android/gradlew
CHANGED
|
File without changes
|
|
@@ -128,12 +128,14 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
128
128
|
firstPhoto != null ? new OkayCamCaptureConfig(
|
|
129
129
|
firstPhoto.getInt("delay"),
|
|
130
130
|
firstPhoto.getBoolean("onFlash"),
|
|
131
|
-
firstPhoto.getString("outputPath")
|
|
131
|
+
firstPhoto.getString("outputPath"),
|
|
132
|
+
firstPhoto.getBoolean("onImageQuality")
|
|
132
133
|
) : null,
|
|
133
134
|
secondPhoto != null ? new OkayCamCaptureConfig(
|
|
134
135
|
secondPhoto.getInt("delay"),
|
|
135
136
|
secondPhoto.getBoolean("onFlash"),
|
|
136
|
-
secondPhoto.getString("outputPath")
|
|
137
|
+
secondPhoto.getString("outputPath"),
|
|
138
|
+
secondPhoto.getBoolean("onImageQuality")
|
|
137
139
|
) : null
|
|
138
140
|
));
|
|
139
141
|
|
package/index.ts
CHANGED
|
@@ -61,6 +61,7 @@ interface CaptureConfig {
|
|
|
61
61
|
delay: number;
|
|
62
62
|
onFlash: Boolean;
|
|
63
63
|
outputPath?: string;
|
|
64
|
+
onImageQuality: Boolean;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
interface SwitchBtnConfig {
|
|
@@ -75,6 +76,13 @@ const defaultColor = "#ffffff";
|
|
|
75
76
|
const defaultColor2 = "#ffa500";
|
|
76
77
|
const imageResizedWidth = -1;
|
|
77
78
|
|
|
79
|
+
const imageResolvedAssetSource: ImageResolvedAssetSource = {
|
|
80
|
+
height: 0,
|
|
81
|
+
width: 0,
|
|
82
|
+
scale: 0,
|
|
83
|
+
uri: "",
|
|
84
|
+
};
|
|
85
|
+
|
|
78
86
|
const labelConfig: LabelConfig = {
|
|
79
87
|
text: "",
|
|
80
88
|
color: defaultColor,
|
|
@@ -87,7 +95,7 @@ const defaultFrame: Frame = {
|
|
|
87
95
|
height: (screenWidth * 54) / 85,
|
|
88
96
|
},
|
|
89
97
|
color: defaultColor,
|
|
90
|
-
content:
|
|
98
|
+
content: imageResolvedAssetSource,
|
|
91
99
|
};
|
|
92
100
|
|
|
93
101
|
const timerConfig: TimerConfig = {
|
|
@@ -105,31 +113,37 @@ const defaultCaptureBtnColor: string = defaultColor;
|
|
|
105
113
|
const captureConfigFirst: CaptureConfig = {
|
|
106
114
|
delay: 0,
|
|
107
115
|
onFlash: false,
|
|
108
|
-
outputPath:
|
|
116
|
+
outputPath: "",
|
|
117
|
+
onImageQuality: false,
|
|
109
118
|
};
|
|
110
119
|
|
|
111
|
-
const defaultPreview: OkayCamPreviewConfig = null
|
|
120
|
+
const defaultPreview: OkayCamPreviewConfig = null!;
|
|
112
121
|
|
|
113
|
-
const defaultInstruction: OkayCamInstruction = null
|
|
122
|
+
const defaultInstruction: OkayCamInstruction = null!;
|
|
114
123
|
|
|
115
|
-
const captureConfigSecond: CaptureConfig =
|
|
124
|
+
const captureConfigSecond: CaptureConfig = {
|
|
125
|
+
delay: 5,
|
|
126
|
+
onFlash: false,
|
|
127
|
+
outputPath: "",
|
|
128
|
+
onImageQuality: false,
|
|
129
|
+
};
|
|
116
130
|
|
|
117
131
|
const formatImage = (img: ImageResolvedAssetSource) => {
|
|
118
|
-
return Image.resolveAssetSource(img).uri;
|
|
119
|
-
|
|
132
|
+
// return Image.resolveAssetSource(img).uri;
|
|
133
|
+
return img;
|
|
120
134
|
};
|
|
121
135
|
|
|
122
136
|
const formatInstruction = (
|
|
123
137
|
instruction: OkayCamInstruction
|
|
124
138
|
): OkayCamInstruction => {
|
|
125
|
-
if (instruction == null) return null
|
|
139
|
+
if (instruction == null) return null!;
|
|
126
140
|
|
|
127
141
|
const ref1: OkaycamInstructionRefImg = {
|
|
128
142
|
...instruction.refImage1,
|
|
129
143
|
img: formatImage(instruction.refImage1.img),
|
|
130
144
|
};
|
|
131
145
|
|
|
132
|
-
let ref2: OkaycamInstructionRefImg = null
|
|
146
|
+
let ref2: OkaycamInstructionRefImg = null!;
|
|
133
147
|
if (instruction.refImage2 != null) {
|
|
134
148
|
ref2 = {
|
|
135
149
|
...instruction.refImage2,
|
|
@@ -168,10 +182,98 @@ export const captureDocument = (
|
|
|
168
182
|
instruction = defaultInstruction,
|
|
169
183
|
}
|
|
170
184
|
) => {
|
|
185
|
+
if (topLabel.text == undefined) {
|
|
186
|
+
topLabel.text = labelConfig.text;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (topLabel.color == undefined) {
|
|
190
|
+
topLabel.color = labelConfig.color;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (topLabel.size == undefined) {
|
|
194
|
+
topLabel.size = labelConfig.size;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (bottomLabel.text == undefined) {
|
|
198
|
+
bottomLabel.text = labelConfig.text;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (bottomLabel.color == undefined) {
|
|
202
|
+
bottomLabel.color = labelConfig.color;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (bottomLabel.size == undefined) {
|
|
206
|
+
bottomLabel.size = labelConfig.size;
|
|
207
|
+
}
|
|
208
|
+
|
|
171
209
|
if (frame.size == undefined) {
|
|
172
210
|
frame.size = defaultFrame.size;
|
|
173
211
|
}
|
|
174
212
|
|
|
213
|
+
if (timer.backgroundColor == undefined || timer.textColor == undefined) {
|
|
214
|
+
timer.backgroundColor = timerConfig.backgroundColor;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (timer.textColor == undefined) {
|
|
218
|
+
timer.textColor = timerConfig.textColor;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (confirmBtnConfig.backgroundColor == undefined) {
|
|
222
|
+
confirmBtnConfig.backgroundColor = okayCamBtnConfig.backgroundColor;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (confirmBtnConfig.contentColor == undefined) {
|
|
226
|
+
confirmBtnConfig.contentColor = okayCamBtnConfig.contentColor;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (retakeBtnConfig.backgroundColor == undefined) {
|
|
230
|
+
retakeBtnConfig.backgroundColor = okayCamBtnConfig.backgroundColor;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (retakeBtnConfig.contentColor == undefined) {
|
|
234
|
+
retakeBtnConfig.contentColor = okayCamBtnConfig.contentColor;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (captureBtnColor == undefined) {
|
|
238
|
+
captureBtnColor = defaultCaptureBtnColor;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (firstPhotoConfig.delay == undefined) {
|
|
242
|
+
firstPhotoConfig.delay = captureConfigFirst.delay;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (firstPhotoConfig.onFlash == undefined) {
|
|
246
|
+
firstPhotoConfig.onFlash = captureConfigFirst.onFlash;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (firstPhotoConfig.onImageQuality == undefined) {
|
|
250
|
+
firstPhotoConfig.onImageQuality = captureConfigFirst.onImageQuality;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (firstPhotoConfig.outputPath == undefined) {
|
|
254
|
+
firstPhotoConfig.outputPath = captureConfigFirst.outputPath;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (secondPhotoConfig.delay == undefined) {
|
|
258
|
+
secondPhotoConfig.delay = captureConfigSecond.delay;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (secondPhotoConfig.onFlash == undefined) {
|
|
262
|
+
secondPhotoConfig.onFlash = captureConfigSecond.onFlash;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (secondPhotoConfig.onImageQuality == undefined) {
|
|
266
|
+
secondPhotoConfig.onImageQuality = captureConfigSecond.onImageQuality;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (secondPhotoConfig.outputPath == undefined) {
|
|
270
|
+
secondPhotoConfig.outputPath = captureConfigSecond.outputPath;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (width == undefined) {
|
|
274
|
+
width = imageResizedWidth;
|
|
275
|
+
}
|
|
276
|
+
|
|
175
277
|
const resultedPreview =
|
|
176
278
|
preview == null
|
|
177
279
|
? null
|
|
@@ -253,6 +355,54 @@ export const captureSelfie = (
|
|
|
253
355
|
imageQuality = 1.0,
|
|
254
356
|
}
|
|
255
357
|
) => {
|
|
358
|
+
if (topLabel.text == undefined) {
|
|
359
|
+
topLabel.text = labelConfig.text;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (topLabel.color == undefined) {
|
|
363
|
+
topLabel.color = labelConfig.color;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (topLabel.size == undefined) {
|
|
367
|
+
topLabel.size = labelConfig.size;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (switchBtnConfig.color == undefined) {
|
|
371
|
+
switchBtnConfig.color = defaultSwitchBtnConfig.color;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (switchBtnConfig.show == undefined) {
|
|
375
|
+
switchBtnConfig.show = defaultSwitchBtnConfig.show;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (confirmBtnConfig.backgroundColor == undefined) {
|
|
379
|
+
confirmBtnConfig.backgroundColor = okayCamBtnConfig.backgroundColor;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (confirmBtnConfig.contentColor == undefined) {
|
|
383
|
+
confirmBtnConfig.contentColor = okayCamBtnConfig.contentColor;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (retakeBtnConfig.backgroundColor == undefined) {
|
|
387
|
+
retakeBtnConfig.backgroundColor = okayCamBtnConfig.backgroundColor;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (retakeBtnConfig.contentColor == undefined) {
|
|
391
|
+
retakeBtnConfig.contentColor = okayCamBtnConfig.contentColor;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (defaultCameraFacing == undefined) {
|
|
395
|
+
defaultCameraFacing = cameraFacing;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (captureBtnColor == undefined) {
|
|
399
|
+
captureBtnColor = defaultCaptureBtnColor;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (width == undefined) {
|
|
403
|
+
width = imageResizedWidth;
|
|
404
|
+
}
|
|
405
|
+
|
|
256
406
|
return new Promise(function (resolve, reject) {
|
|
257
407
|
RNOkayCam.captureSelfie({
|
|
258
408
|
license: license,
|
package/ios/RNOkayCam.swift
CHANGED
|
@@ -106,12 +106,12 @@ class RNOkayCam: NSObject {
|
|
|
106
106
|
okayCamConfig.captureConfigPair = CaptureConfigPair(
|
|
107
107
|
firstPhoto: OkayCamCaptureConfig(
|
|
108
108
|
timeOut: firstPhoto.object(forKey: "delay") as! Int,
|
|
109
|
-
onFlash: firstPhoto.object(forKey: "onFlash") as! Bool,
|
|
109
|
+
onFlash: firstPhoto.object(forKey: "onFlash") as! Bool, onImageQuality: firstPhoto.object(forKey: "onImageQuality") as! Bool,
|
|
110
110
|
outputPath: (firstPhotoPath != nil) ? URL(string: (firstPhoto.object(forKey: "outputPath") as? String)!) : nil
|
|
111
111
|
),
|
|
112
112
|
secondPhoto: (secondPhoto != nil) ? OkayCamCaptureConfig(
|
|
113
113
|
timeOut: secondPhoto?.object(forKey: "delay") as? Int ?? 0,
|
|
114
|
-
onFlash: secondPhoto?.object(forKey: "onFlash") as? Bool ?? false,
|
|
114
|
+
onFlash: secondPhoto?.object(forKey: "onFlash") as? Bool ?? false, onImageQuality: secondPhoto?.object(forKey: "onImageQuality") as! Bool,
|
|
115
115
|
outputPath: (secondPhotoPath != nil) ? URL(string: (secondPhoto?.object(forKey: "outputPath") as! String?)!) : nil
|
|
116
116
|
) : nil
|
|
117
117
|
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-okaycam",
|
|
3
3
|
"title": "React Native OkayCam",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.29",
|
|
5
5
|
"description": "React-Native version of OkayCam",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"files": [
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"react": "^16.9.0",
|
|
38
|
-
"react-native": "^0.
|
|
38
|
+
"react-native": "^0.65.1"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@types/react-native": "^0.71.3",
|
|
42
|
+
"react-native-codegen": "^0.0.7"
|
|
39
43
|
}
|
|
40
44
|
}
|
package/android/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/android/.idea/.gitignore
DELETED
package/android/.idea/gradle.xml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="GRADLE" />
|
|
8
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
-
<option name="gradleJvm" value="11" />
|
|
11
|
-
<option name="modules">
|
|
12
|
-
<set>
|
|
13
|
-
<option value="$PROJECT_DIR$" />
|
|
14
|
-
</set>
|
|
15
|
-
</option>
|
|
16
|
-
<option name="resolveModulePerSourceSet" value="false" />
|
|
17
|
-
</GradleProjectSettings>
|
|
18
|
-
</option>
|
|
19
|
-
</component>
|
|
20
|
-
</project>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
-
<remote-repository>
|
|
5
|
-
<option name="id" value="central" />
|
|
6
|
-
<option name="name" value="Maven Central repository" />
|
|
7
|
-
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
-
</remote-repository>
|
|
9
|
-
<remote-repository>
|
|
10
|
-
<option name="id" value="jboss.community" />
|
|
11
|
-
<option name="name" value="JBoss Community repository" />
|
|
12
|
-
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
-
</remote-repository>
|
|
14
|
-
<remote-repository>
|
|
15
|
-
<option name="id" value="MavenRepo" />
|
|
16
|
-
<option name="name" value="MavenRepo" />
|
|
17
|
-
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
18
|
-
</remote-repository>
|
|
19
|
-
<remote-repository>
|
|
20
|
-
<option name="id" value="Google" />
|
|
21
|
-
<option name="name" value="Google" />
|
|
22
|
-
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
23
|
-
</remote-repository>
|
|
24
|
-
<remote-repository>
|
|
25
|
-
<option name="id" value="maven" />
|
|
26
|
-
<option name="name" value="maven" />
|
|
27
|
-
<option name="url" value="https://s01.oss.sonatype.org/content/repositories/cominnov8tif-1061" />
|
|
28
|
-
</remote-repository>
|
|
29
|
-
<remote-repository>
|
|
30
|
-
<option name="id" value="maven" />
|
|
31
|
-
<option name="name" value="maven" />
|
|
32
|
-
<option name="url" value="https://s01.oss.sonatype.org/content/repositories/cominnov8tif-1062" />
|
|
33
|
-
</remote-repository>
|
|
34
|
-
<remote-repository>
|
|
35
|
-
<option name="id" value="maven" />
|
|
36
|
-
<option name="name" value="maven" />
|
|
37
|
-
<option name="url" value="https://s01.oss.sonatype.org/content/repositories/cominnov8tif-1063" />
|
|
38
|
-
</remote-repository>
|
|
39
|
-
<remote-repository>
|
|
40
|
-
<option name="id" value="maven" />
|
|
41
|
-
<option name="name" value="maven" />
|
|
42
|
-
<option name="url" value="https://s01.oss.sonatype.org/content/repositories/cominnov8tif-1064" />
|
|
43
|
-
</remote-repository>
|
|
44
|
-
</component>
|
|
45
|
-
</project>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.activity:activity:1.0.0@aar">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/da312bfad18124b605d313e917900960/transformed/activity-1.0.0/jars/classes.jar!/" />
|
|
5
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/da312bfad18124b605d313e917900960/transformed/activity-1.0.0/res" />
|
|
6
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/da312bfad18124b605d313e917900960/transformed/activity-1.0.0/AndroidManifest.xml" />
|
|
7
|
-
</CLASSES>
|
|
8
|
-
<JAVADOC />
|
|
9
|
-
<SOURCES>
|
|
10
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.activity/activity/1.0.0/28eb83e6a29ac3fbb87aa632cfa0e644a313f491/activity-1.0.0-sources.jar!/" />
|
|
11
|
-
</SOURCES>
|
|
12
|
-
</library>
|
|
13
|
-
</component>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.annotation:annotation:1.2.0">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.2.0/57136ff68ee784c6e19db34ed4a175338fadfde1/annotation-1.2.0.jar!/" />
|
|
5
|
-
</CLASSES>
|
|
6
|
-
<JAVADOC />
|
|
7
|
-
<SOURCES>
|
|
8
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.2.0/8945212022e5276658ab7864714ced3553ea724a/annotation-1.2.0-sources.jar!/" />
|
|
9
|
-
</SOURCES>
|
|
10
|
-
</library>
|
|
11
|
-
</component>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.appcompat:appcompat:1.1.0@aar">
|
|
3
|
-
<ANNOTATIONS>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/8bad765fb0c44392f5cbc11d5eec1b3c/transformed/appcompat-1.1.0/annotations.zip!/" />
|
|
5
|
-
</ANNOTATIONS>
|
|
6
|
-
<CLASSES>
|
|
7
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/8bad765fb0c44392f5cbc11d5eec1b3c/transformed/appcompat-1.1.0/jars/classes.jar!/" />
|
|
8
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/8bad765fb0c44392f5cbc11d5eec1b3c/transformed/appcompat-1.1.0/res" />
|
|
9
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/8bad765fb0c44392f5cbc11d5eec1b3c/transformed/appcompat-1.1.0/AndroidManifest.xml" />
|
|
10
|
-
</CLASSES>
|
|
11
|
-
<JAVADOC />
|
|
12
|
-
<SOURCES>
|
|
13
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.appcompat/appcompat/1.1.0/9865019bbd2d95e41dede3d8ebf964aa93f97766/appcompat-1.1.0-sources.jar!/" />
|
|
14
|
-
</SOURCES>
|
|
15
|
-
</library>
|
|
16
|
-
</component>
|
package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.appcompat:appcompat-resources:1.1.0@aar">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/bc7b4694fcf64bb50365a9b9f1e36a4e/transformed/appcompat-resources-1.1.0/jars/classes.jar!/" />
|
|
5
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/bc7b4694fcf64bb50365a9b9f1e36a4e/transformed/appcompat-resources-1.1.0/res" />
|
|
6
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/bc7b4694fcf64bb50365a9b9f1e36a4e/transformed/appcompat-resources-1.1.0/AndroidManifest.xml" />
|
|
7
|
-
</CLASSES>
|
|
8
|
-
<JAVADOC />
|
|
9
|
-
<SOURCES>
|
|
10
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.appcompat/appcompat-resources/1.1.0/a7dcffd1afb81e3c892ad061b33da031c2d7289f/appcompat-resources-1.1.0-sources.jar!/" />
|
|
11
|
-
</SOURCES>
|
|
12
|
-
</library>
|
|
13
|
-
</component>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.arch.core:core-common:2.1.0">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-common/2.1.0/b3152fc64428c9354344bd89848ecddc09b6f07e/core-common-2.1.0.jar!/" />
|
|
5
|
-
</CLASSES>
|
|
6
|
-
<JAVADOC />
|
|
7
|
-
<SOURCES>
|
|
8
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-common/2.1.0/80ac2d7c8e6400ce2fbc663cd1a7e1cbef38c4b8/core-common-2.1.0-sources.jar!/" />
|
|
9
|
-
</SOURCES>
|
|
10
|
-
</library>
|
|
11
|
-
</component>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<component name="libraryTable">
|
|
2
|
-
<library name="Gradle: androidx.arch.core:core-runtime:2.1.0@aar">
|
|
3
|
-
<CLASSES>
|
|
4
|
-
<root url="jar://$USER_HOME$/.gradle/caches/transforms-3/774ee57ccf13a9a46aba03e36f06e20e/transformed/core-runtime-2.1.0/jars/classes.jar!/" />
|
|
5
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/774ee57ccf13a9a46aba03e36f06e20e/transformed/core-runtime-2.1.0/res" />
|
|
6
|
-
<root url="file://$USER_HOME$/.gradle/caches/transforms-3/774ee57ccf13a9a46aba03e36f06e20e/transformed/core-runtime-2.1.0/AndroidManifest.xml" />
|
|
7
|
-
</CLASSES>
|
|
8
|
-
<JAVADOC />
|
|
9
|
-
<SOURCES>
|
|
10
|
-
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.arch.core/core-runtime/2.1.0/f19886651c9946b39f83d8c184fd0e2ce9f43c16/core-runtime-2.1.0-sources.jar!/" />
|
|
11
|
-
</SOURCES>
|
|
12
|
-
</library>
|
|
13
|
-
</component>
|