Skip to content

Commit

Permalink
Release 51.4.0 (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichanyline authored Apr 8, 2024
1 parent 3d36d24 commit 521a136
Show file tree
Hide file tree
Showing 20 changed files with 275 additions and 113 deletions.
2 changes: 1 addition & 1 deletion example/RNExampleApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 5
versionName "51.3.1"
versionName "51.4.0"
multiDexEnabled true

buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
Expand Down
110 changes: 82 additions & 28 deletions example/RNExampleApp/config/TINDOTConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,7 @@ export default {
"y": 0
}
},
"defaultOrientation": "landscape",
"instruction": {
"text": "Please make sure the entire DOT number is inside the cutout.",
},
"feedback": {
"format": {
"text": "Wrong format detected",
"image": "ic_wrong_format"
},
"brightness": {
"too_high": {
"text": "Too bright",
"image": "ic_too_bright"
},
"too_low": {
"text": "Too dark",
"image": "ic_too_dark"
}
},
"distance": {
"text": "Position cutout correctly",
"image": "ic_move_back"
},
"sound": "info_sound_TIN.wav"
},
"imageCutout": {
"image": "dot_overlay"
}
"defaultOrientation": "landscape"
},
"cameraConfig": {
"captureResolution": "1080p",
Expand Down Expand Up @@ -83,6 +56,87 @@ export default {
"beepOnResult": true,
"vibrateOnResult": false,
"strokeWidth": 2
},
"uiFeedbackConfig": {
"presets": [
{
"presetName": "tin_custom_v1",
"presetAttributes": [
{
"attributeName": "lighting_toodark_image",
"attributeValue": "uifeedback_tin_toodark"
},
{
"attributeName": "lighting_toobright_image",
"attributeValue": "uifeedback_tin_toobright"
},
{
"attributeName": "distance_moveback_image",
"attributeValue": "uifeedback_tin_moveback"
},
{
"attributeName": "distance_movecloser_image",
"attributeValue": "uifeedback_tin_movecloser"
},
{
"attributeName": "format_wrong_image",
"attributeValue": "uifeedback_tin_wrongformat"
},
{
"attributeName": "date_wrong_image",
"attributeValue": "uifeedback_tin_wrongformat"
},
{
"attributeName": "lighting_toodark_text",
"attributeValue": ""
},
{
"attributeName": "lighting_toobright_text",
"attributeValue": ""
},
{
"attributeName": "distance_moveback_text",
"attributeValue": ""
},
{
"attributeName": "distance_movecloser_text",
"attributeValue": ""
},
{
"attributeName": "format_wrong_text",
"attributeValue": ""
},
{
"attributeName": "date_wrong_text",
"attributeValue": ""
},
{
"attributeName": "lighting_toodark_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "lighting_toobright_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "distance_moveback_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "distance_movecloser_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "format_wrong_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "date_wrong_sound",
"attributeValue": "info_sound_TIN.wav"
}
]
}
]
}
}
}
108 changes: 81 additions & 27 deletions example/RNExampleApp/config/TINUniversalConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@ export default {
"x": 0,
"y": 0
}
},
"instruction": {
"text": "Please make sure the entire DOT number is inside the cutout.",
},
"feedback": {
"format": {
"text": "Wrong format detected",
"image": "ic_wrong_format"
},
"brightness": {
"too_high": {
"text": "Too bright",
"image": "ic_too_bright"
},
"too_low": {
"text": "Too dark",
"image": "ic_too_dark"
}
},
"distance": {
"text": "Position cutout correctly",
"image": "ic_move_back"
},
"sound": "info_sound_TIN.wav"
},
"imageCutout": {
"image": "dot_overlay"
}
},
"cameraConfig": {
Expand Down Expand Up @@ -81,6 +54,87 @@ export default {
"beepOnResult": true,
"vibrateOnResult": false,
"strokeWidth": 2
},
"uiFeedbackConfig": {
"presets": [
{
"presetName": "tin_custom_v1",
"presetAttributes": [
{
"attributeName": "lighting_toodark_image",
"attributeValue": "uifeedback_tin_toodark"
},
{
"attributeName": "lighting_toobright_image",
"attributeValue": "uifeedback_tin_toobright"
},
{
"attributeName": "distance_moveback_image",
"attributeValue": "uifeedback_tin_moveback"
},
{
"attributeName": "distance_movecloser_image",
"attributeValue": "uifeedback_tin_movecloser"
},
{
"attributeName": "format_wrong_image",
"attributeValue": "uifeedback_tin_wrongformat"
},
{
"attributeName": "date_wrong_image",
"attributeValue": "uifeedback_tin_wrongformat"
},
{
"attributeName": "lighting_toodark_text",
"attributeValue": ""
},
{
"attributeName": "lighting_toobright_text",
"attributeValue": ""
},
{
"attributeName": "distance_moveback_text",
"attributeValue": ""
},
{
"attributeName": "distance_movecloser_text",
"attributeValue": ""
},
{
"attributeName": "format_wrong_text",
"attributeValue": ""
},
{
"attributeName": "date_wrong_text",
"attributeValue": ""
},
{
"attributeName": "lighting_toodark_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "lighting_toobright_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "distance_moveback_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "distance_movecloser_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "format_wrong_sound",
"attributeValue": "info_sound_TIN.wav"
},
{
"attributeName": "date_wrong_sound",
"attributeValue": "info_sound_TIN.wav"
}
]
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RNExampleApp/Pods-RNExampleApp-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_51.3.1/Framework/AnylineResources.bundle",
"${PODS_ROOT}/Anyline/AnylineSDK_iOS_51.4.0/Framework/AnylineResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand Down Expand Up @@ -365,7 +365,7 @@
INFOPLIST_FILE = RNExampleApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 51.3.1;
MARKETING_VERSION = 51.4.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -398,7 +398,7 @@
INFOPLIST_FILE = RNExampleApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 51.3.1;
MARKETING_VERSION = 51.4.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion example/RNExampleApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-example-app",
"version": "51.3.1",
"version": "51.4.0",
"private": true,
"scripts": {
"initProject": "yarn add expo && yarn add ../../plugin",
Expand Down
6 changes: 5 additions & 1 deletion example/RNExampleApp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Anyline extends Component {
currentScanMode: '',
buttonsDisabled: false,
SDKVersion: '',
pluginVersion: '',
hasMultipleResults: false,
licenseMessage: '',
titles: [],
Expand All @@ -89,8 +90,9 @@ class Anyline extends Component {
}

const SDKVersion = await AnylineOCR.getSDKVersion();
const pluginVersion = AnylineOCR.getPluginVersion();

this.setState({ SDKVersion: SDKVersion, licenseMessage: licenseMessage, buttonsDisabled: !licenseInitSuccess });
this.setState({ SDKVersion: SDKVersion, pluginVersion: pluginVersion, licenseMessage: licenseMessage, buttonsDisabled: !licenseInitSuccess });
};

componentDidUpdate() {
Expand Down Expand Up @@ -355,6 +357,7 @@ class Anyline extends Component {
currentScanMode,
buttonsDisabled,
SDKVersion,
pluginVersion,
licenseMessage,
hasMultipleResults,
titles,
Expand Down Expand Up @@ -416,6 +419,7 @@ class Anyline extends Component {

<View style={styles.footer}>
<Text style={styles.versions}>SDK: {SDKVersion}</Text>
<Text style={styles.versions}>Plugin: {pluginVersion}</Text>
{
(licenseMessage && licenseMessage.length > 0) ?
<Text key='licenseMessage' style={styles.versions}>
Expand Down
2 changes: 1 addition & 1 deletion plugin/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ repositories {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'io.anyline:anylinesdk:51.3.1'
implementation 'io.anyline:anylinesdk:51.4.0'
implementation "com.facebook.react:react-native:+"
implementation("com.google.android.material:material:1.9.0")
implementation 'androidx.multidex:multidex:2.0.1'
Expand Down
Binary file removed plugin/android/src/main/assets/info_sound_TIN.wav
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.io.IOException;
import java.util.HashMap;

import io.anyline2.WrapperConfig;
import io.anyline2.WrapperInfo;
import io.anyline2.core.ScanController;
import io.anyline2.legacy.products.AnylineUpdater;
import io.anyline2.legacy.trainer.AssetContext;
Expand Down Expand Up @@ -53,6 +55,8 @@ class AnylineSDKPlugin extends ReactContextBaseJavaModule implements ResultRepor
private String config;
private AssetContextJsonParser assetContextJsonParser;

private static WrapperConfig wrapperConfig;

AnylineSDKPlugin(ReactApplicationContext context) {
super(context);
this.reactContext = context;
Expand All @@ -69,6 +73,13 @@ public void getSDKVersion(final Promise promise) {
promise.resolve(at.nineyards.anyline.BuildConfig.VERSION_NAME);
}

@ReactMethod
protected void setPluginVersion(final String pluginVersion) {
wrapperConfig = new WrapperConfig.Wrapper(
new WrapperInfo(WrapperInfo.WrapperType.ReactNative, pluginVersion)
);
}

@ReactMethod
public void licenseKeyExpiryDate(final Promise promise) {
try {
Expand Down Expand Up @@ -125,7 +136,7 @@ public void setupAnylineSDKWithCacheConfig(String license, boolean enableOffline
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
}
try {
AnylineSdk.init(license, reactContext, "", cacheConfig);
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
this.license = license;
if (promise != null) {
promise.resolve(true);
Expand All @@ -150,7 +161,7 @@ public void initSdk(String license, boolean enableOfflineCache) {
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
}
try {
AnylineSdk.init(license, reactContext, "", cacheConfig);
AnylineSdk.init(license, reactContext, "", cacheConfig, wrapperConfig);
} catch (LicenseException e) {
e.printStackTrace();
returnError(e.getMessage());
Expand Down Expand Up @@ -259,7 +270,7 @@ private void scan() throws LicenseException, JSONException {
if (configObject.has("license")) {
//if there is a license on JSON config then this license will be
//used to init or re-init the SDK
AnylineSdk.init(configObject.getString("license"), reactContext);
AnylineSdk.init(configObject.getString("license"), reactContext, "", CacheConfig.Preset.Default.INSTANCE, wrapperConfig);
license = configObject.get("license").toString();
} else {
throw new JSONException("No License in config. Please check your configuration.");
Expand Down
Loading

0 comments on commit 521a136

Please sign in to comment.