Skip to content

Commit

Permalink
Release 51.4.0 (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichanyline authored Mar 26, 2024
1 parent 7186318 commit 50930aa
Show file tree
Hide file tree
Showing 22 changed files with 319 additions and 72 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

# 51.3.1
# 51.4.0

Please find the complete and updated release notes at https://documentation.anyline.com/flutter-plugin-component/latest/release-notes.html.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Documentation Resources

- [Getting Started](https://documentation.anyline.com/flutter-plugin-component/latest/index.html)
- [Changelog](https://documentation.anyline.com/flutter-plugin-component/latest/changelog.html)
- [Release Notes](https://documentation.anyline.com/flutter-plugin-component/latest/release-notes.html)

## Get Help (Support)

Expand Down
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version '1.0'

buildscript {
ext {
anyline_sdk_version = "51.3.1"
anyline_sdk_version = "51.4.0"
kotlin_version = "1.8.0"
}
repositories {
Expand Down Expand Up @@ -44,6 +44,7 @@ android {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

dependencies {
api "io.anyline:anylinesdk:$anyline_sdk_version"
implementation 'com.google.android.material:material:1.4.0-rc01'
Expand Down
17 changes: 14 additions & 3 deletions android/src/main/java/io/anyline/flutter/AnylinePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

import io.anyline2.AnylineSdk;
import io.anyline2.CacheConfig;
import io.anyline2.WrapperConfig;
import io.anyline2.WrapperInfo;
import io.anyline2.core.LicenseException;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
Expand All @@ -38,6 +40,7 @@ public class AnylinePlugin implements
private MethodChannel channel;

private String licenseKey;
private String pluginVersion = "";
private boolean enableOfflineCache = false;
private String customModelsPath = "flutter_assets";
private String viewConfigsPath = "flutter_assets";
Expand Down Expand Up @@ -77,9 +80,10 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
viewConfigsPath = call.argument(Constants.EXTRA_VIEW_CONFIGS_PATH);
} else if (call.method.equals(Constants.METHOD_SET_LICENSE_KEY)) {
licenseKey = call.argument(Constants.EXTRA_LICENSE_KEY);
pluginVersion = call.argument(Constants.EXTRA_PLUGIN_VERSION);
enableOfflineCache = Boolean.TRUE.equals(call.argument(Constants.EXTRA_ENABLE_OFFLINE_CACHE));
try {
initSdk(licenseKey, customModelsPath, enableOfflineCache);
initSdk(licenseKey, customModelsPath, pluginVersion, enableOfflineCache);
result.success(true);
}
catch (LicenseException le) {
Expand All @@ -95,13 +99,20 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
}
}

private void initSdk(String sdkLicenseKey, String sdkAssetsFolder, boolean enableOfflineCache)
private void initSdk(String sdkLicenseKey,
String sdkAssetsFolder,
String pluginVersion,
boolean enableOfflineCache)
throws LicenseException {
WrapperConfig wrapperConfig = new WrapperConfig.Wrapper(
new WrapperInfo(WrapperInfo.WrapperType.Flutter, pluginVersion));

CacheConfig.Preset cacheConfig = CacheConfig.Preset.Default.INSTANCE;
if (enableOfflineCache) {
cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE;
}
AnylineSdk.init(sdkLicenseKey, activity, sdkAssetsFolder, cacheConfig);

AnylineSdk.init(sdkLicenseKey, activity, sdkAssetsFolder, cacheConfig, wrapperConfig);
}

private void scanAnyline4() {
Expand Down
1 change: 1 addition & 0 deletions android/src/main/java/io/anyline/flutter/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Constants {
public static final String EXTRA_CONFIG_JSON = "EXTRA_CONFIG_JSON";
public static final String EXTRA_LICENSE_KEY = "EXTRA_LICENSE_KEY";
public static final String EXTRA_ENABLE_OFFLINE_CACHE = "EXTRA_ENABLE_OFFLINE_CACHE";
public static final String EXTRA_PLUGIN_VERSION = "EXTRA_PLUGIN_VERSION";
public static final String EXTRA_CUSTOM_MODELS_PATH = "EXTRA_CUSTOM_MODELS_PATH";
public static final String EXTRA_VIEW_CONFIGS_PATH = "EXTRA_VIEW_CONFIGS_PATH";

Expand Down
6 changes: 6 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# note: do not ignore pubspec.lock for the example app (on the same note, the Podfile.lock).

ios/Runner.xcodeproj/xcshareddata/

.vscode
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ If you want to just get the plugin working as quickly as possible, see the examp

## Getting Started

This project includes an Anyline Flutter Demo App with configurations for 22+ use cases. You can use the app code located in the [`main.dart`](https://github.com/Anyline/anyline-ocr-flutter-module/blob/main/example/lib/main.dart) file as orientation for your own implementation, but we strongly advise against using the same result processing approach as we did in our demo app. The reason why we only used `Map<String,dynamic>` and not custom model classes for storing results and therefore went without Dart typesafety is because for our purpose of only displaying results this was not really necessary. Creating classes for every single use would have been an overkill for this project, but we strongly encourage you to read our [Anyline Flutter Guide on documentation.anyline.com](https://documentation.anyline.com/toc/platforms/flutter/getting_started.html#anyline-flutter-guide), where we go into detail about result processing and the form of all different possible results.
This project includes an Anyline Flutter Demo App with configurations for 22+ use cases. You can use the app code located in the [`main.dart`](https://github.com/Anyline/anyline-ocr-flutter-module/blob/main/example/lib/main.dart) file as orientation for your own implementation, but we strongly advise against using the same result processing approach as we did in our demo app. The reason why we only used `Map<String,dynamic>` and not custom model classes for storing results and therefore went without Dart typesafety is because for our purpose of only displaying results this was not really necessary. Creating classes for every single use would have been an overkill for this project, but we strongly encourage you to read our [Anyline Flutter Guide on documentation.anyline.com](https://documentation.anyline.com/flutter-plugin-component/latest/getting-started.html), where we go into detail about result processing and the form of all different possible results.
137 changes: 137 additions & 0 deletions example/config/TINDOTWithUIFeedbackConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"options": {
"doneButtonConfig": {
"offset.y": -96
},
"rotateButton": {
"alignment": "top_right",
"offset": {
"x": 0,
"y": 0
}
},
"defaultOrientation": "landscape"
},
"cameraConfig": {
"captureResolution": "1080p",
"zoomGesture": true
},
"flashConfig": {
"mode": "manual",
"alignment": "top_left"
},
"viewPluginConfig": {
"pluginConfig": {
"id": "tire_tin",
"cancelOnResult": true,
"tinConfig": {
"scanMode": "DOT"
}
},
"cutoutConfig": {
"maxWidthPercent": "60%",
"maxHeightPercent": "60%",
"alignment": "center",
"strokeWidth": 2,
"cornerRadius": 4,
"strokeColor": "0099FF",
"outerColor": "000000",
"outerAlpha": 0.3,
"ratioFromSize": {
"width": 5,
"height": 1
},
"feedbackStrokeColor": "0099FF"
},
"scanFeedbackConfig": {
"animation": "traverse_multi",
"animationDuration": 250,
"style": "rect",
"strokeColor": "0099FF",
"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"
}
]
}
]
}
}
}
2 changes: 1 addition & 1 deletion example/config/license.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"licenseKey": ""
}
}
2 changes: 2 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source 'https://github.com/CocoaPods/Specs.git'

# Uncomment this line to define a global platform for your project
platform :ios, '12.0'

Expand Down
20 changes: 10 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PODS:
- Anyline (51.3.1)
- anyline_plugin (51.3.1):
- Anyline (51.4.0)
- anyline_plugin (51.4.0):
- Anyline (~> 51)
- Flutter
- Flutter (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.1.1):
- permission_handler_apple (9.3.0):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
Expand All @@ -21,7 +21,7 @@ DEPENDENCIES:
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

SPEC REPOS:
trunk:
https://github.com/CocoaPods/Specs.git:
- Anyline

EXTERNAL SOURCES:
Expand All @@ -37,13 +37,13 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
Anyline: c3240b4176f947254b6e2c8ea4e168a75c9c9e7f
anyline_plugin: 70c78cf6dcef1e575f7acd6bd7f1f5f99dbdf3f5
Anyline: 007428dc62f87f4ef25c93eb4f00b6a49eeea5fd
anyline_plugin: e9b5f89816bacb68aa791ad3e02cebca45136708
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695

PODFILE CHECKSUM: 8f522979e3f0c708f1d45db223b2aecbf369433f
PODFILE CHECKSUM: 1ba8e470e8138e872af9577a0e261e59d83eaf57

COCOAPODS: 1.15.2
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 51.3.1;
MARKETING_VERSION = 51.4.0;
PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -545,7 +545,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 51.3.1;
MARKETING_VERSION = 51.4.0;
PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -578,7 +578,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 51.3.1;
MARKETING_VERSION = 51.4.0;
PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
7 changes: 7 additions & 0 deletions example/lib/anyline_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ abstract class AnylineService {
List<Result> getResultList();

String? getSdkVersion();
String? getPluginVersion();
}

class AnylineServiceImpl implements AnylineService {
Expand All @@ -26,6 +27,7 @@ class AnylineServiceImpl implements AnylineService {
LicenseState licenseState = new LicenseState(false, 'Sdk not initialised');
List<Result> _results = [];
String? _sdkVersion = 'Unknown';
String? _pluginVersion = 'Unknown';

AnylineServiceImpl() {
_initAnylinePlugin();
Expand Down Expand Up @@ -60,6 +62,10 @@ class AnylineServiceImpl implements AnylineService {
return _sdkVersion;
}

String? getPluginVersion() {
return _pluginVersion;
}

_initAnylinePlugin() async {
String? sdkVersion;
try {
Expand All @@ -68,6 +74,7 @@ class AnylineServiceImpl implements AnylineService {
sdkVersion = 'Failed to get SDK version.';
}
_sdkVersion = sdkVersion;
_pluginVersion = await AnylinePlugin.pluginVersion;

anylinePlugin = AnylinePlugin();
anylinePlugin.setCustomModelsPath("flutter_assets/custom_scripts");
Expand Down
11 changes: 10 additions & 1 deletion example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ class _HomeState extends State<Home> {
content: FittedBox(
fit: BoxFit.fitWidth,
child: Text(
'SDK Version ${_anylineService.getSdkVersion()}')),
'SDK Version ${_anylineService.getSdkVersion()}' +
'\n' +
'Plugin Version ${_anylineService.getPluginVersion()}'
)),
));
},
),
Expand Down Expand Up @@ -399,6 +402,12 @@ class _HomeState extends State<Home> {
scan(ScanMode.TIN);
},
),
ScanButton(
text: 'TIN DOT with UI Feedback',
onPressed: () {
scan(ScanMode.TINDOTWithUIFeedback);
},
),
ScanButton(
text: 'Tire Size',
onPressed: () {
Expand Down
Loading

0 comments on commit 50930aa

Please sign in to comment.