Skip to content

Commit

Permalink
Release 54.0.0 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitlokhandeanyline authored Sep 6, 2024
1 parent 0fab5b7 commit 2cc8bf1
Show file tree
Hide file tree
Showing 32 changed files with 316 additions and 906 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

# 53.0.0
# 54.0.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 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 = "53.3.0"
anyline_sdk_version = "54.0.0"
kotlin_version = "1.8.0"
}
repositories {
Expand Down
9 changes: 3 additions & 6 deletions android/src/main/java/io/anyline/flutter/AnylinePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ 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 @@ -79,9 +76,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
} else if (call.method.equals(Constants.METHOD_SET_VIEW_CONFIGS_PATH)) {
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));
String licenseKey = call.argument(Constants.EXTRA_LICENSE_KEY);
String pluginVersion = call.argument(Constants.EXTRA_PLUGIN_VERSION);
boolean enableOfflineCache = Boolean.TRUE.equals(call.argument(Constants.EXTRA_ENABLE_OFFLINE_CACHE));
try {
initSdk(licenseKey, customModelsPath, pluginVersion, enableOfflineCache);
result.success(true);
Expand Down
11 changes: 5 additions & 6 deletions android/src/main/java/io/anyline/flutter/AnylineUIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ public class AnylineUIConfig {
/**
* Create config from the given json object.
*
* @param context the context
* @param jsonObject the json object with the settings
*/
public AnylineUIConfig(Context context, JSONObject jsonObject) {
initFromJsonObject(context, jsonObject);
public AnylineUIConfig(JSONObject jsonObject) {
initFromJsonObject(jsonObject);
}

private void initFromJsonObject(Context context, JSONObject json) {
private void initFromJsonObject(JSONObject json) {
JSONObject segment = json.optJSONObject(SEGMENT);

if (segment != null) {
Expand All @@ -47,8 +46,8 @@ private void initFromJsonObject(Context context, JSONObject json) {
JSONArray titlesJson = segment.getJSONArray(SEGMENT_TITLES);
JSONArray viewConfigsJson = segment.getJSONArray(SEGMENT_VIEWCONFIGS);

titles = new ArrayList<String>();
viewConfigs = new ArrayList<String>();
titles = new ArrayList<>();
viewConfigs = new ArrayList<>();
for (int i = 0; i < titlesJson.length(); i++) {
titles.add(titlesJson.get(i).toString());
viewConfigs.add(viewConfigsJson.get(i).toString());
Expand Down
26 changes: 8 additions & 18 deletions android/src/main/java/io/anyline/flutter/ScanActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class ScanActivity extends Activity implements CameraOpenListener,
private boolean defaultOrientationApplied;
private static final String KEY_DEFAULT_ORIENTATION_APPLIED = "default_orientation_applied";

private JSONObject configJson;
private JSONObject optionsJson = null;

private Map<String, Barcode> nativeBarcodeMap = null;
Expand Down Expand Up @@ -176,15 +175,9 @@ protected void onPause() {
private void setDebugListener() {
ViewPluginBase scanViewPlugin = anylineScanView.getScanViewPlugin();
if (scanViewPlugin != null) {
scanViewPlugin.scanInfoReceived = jsonObject -> {
Log.d(TAG, "info received: " + jsonObject.toString());
};
scanViewPlugin.runSkippedReceived = jsonObject -> {
Log.d(TAG, "run skipped: " + jsonObject.toString());
};
scanViewPlugin.errorReceived = jsonObject -> {
Log.w(TAG, "error received: " + jsonObject.toString());
};
scanViewPlugin.scanInfoReceived = jsonObject -> Log.d(TAG, "info received: " + jsonObject.toString());
scanViewPlugin.runSkippedReceived = jsonObject -> Log.d(TAG, "run skipped: " + jsonObject.toString());
scanViewPlugin.errorReceived = jsonObject -> Log.w(TAG, "error received: " + jsonObject.toString());
}
}

Expand Down Expand Up @@ -230,8 +223,7 @@ private void setScanConfig(String viewConfigAssetFileName) {
private void setScanConfig(JSONObject scanConfigJson, String viewConfigAssetFileName) {

try {
configJson = scanConfigJson;
optionsJson = configJson.optJSONObject("options");
optionsJson = scanConfigJson.optJSONObject("options");

anylineScanView.getCameraView().removeNativeBarcodeReceivedEventListener(this);
nativeBarcodeMap = null;
Expand All @@ -249,9 +241,7 @@ private void setScanConfig(JSONObject scanConfigJson, String viewConfigAssetFile

ScanViewPlugin scanViewPlugin = viewPluginBase.getFirstActiveScanViewPlugin();

viewPluginBase.resultReceived = scanResult -> {
setResult(scanViewPlugin, AnylinePluginHelper.jsonHelper(scanResult, nativeBarcodeMap).toString());
};
viewPluginBase.resultReceived = scanResult -> setResult(scanViewPlugin, AnylinePluginHelper.jsonHelper(scanResult, nativeBarcodeMap).toString());

viewPluginBase.resultsReceived = scanResults -> {
JSONObject jsonResult = new JSONObject();
Expand Down Expand Up @@ -337,15 +327,15 @@ && getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
}

private void addSegmentRadioButtonUI(JSONObject optionsJson, String currentSegment) {
anylineUIConfig = new AnylineUIConfig(this, optionsJson);
anylineUIConfig = new AnylineUIConfig(optionsJson);
setupRadioGroup(anylineUIConfig, currentSegment);
}

private void setupRadioGroup(AnylineUIConfig anylineUIConfig, String scanModeString) {
ArrayList<String> titles = anylineUIConfig.getTitles();
final ArrayList<String> viewConfigs = anylineUIConfig.getViewConfigs();

if (titles != null && titles.size() > 0) {
if (titles != null && !titles.isEmpty()) {

if (titles.size() != viewConfigs.size()) {
finishWithError(getString(getResources().getIdentifier("error_invalid_segment_config", "string",
Expand Down Expand Up @@ -395,7 +385,7 @@ private void configRotateButtonInView(RotateButtonConfig rotateButtonConfig) {

buttonLayoutParams.gravity = Gravity.TOP | Gravity.RIGHT;
String alignment = rotateButtonConfig.getAlignment();
if (alignment.length() > 0) {
if (!alignment.isEmpty()) {
if (alignment.equals("top_left")) {
buttonLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;
}
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34

ndkVersion '24.0.8215888' // Replace this with the version you're using

Expand All @@ -38,7 +38,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.anyline.flutter.examples"
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/black" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->


</layer-list>
68 changes: 0 additions & 68 deletions example/config/NFCAndMRZConfig.json

This file was deleted.

18 changes: 9 additions & 9 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PODS:
- Anyline (53.3.0)
- anyline_plugin (53.0.0):
- Anyline (~> 53)
- Anyline (54.0.0)
- anyline_plugin (54.0.0):
- Anyline (= 54.0.0)
- Flutter
- Flutter (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.3.0):
- permission_handler_apple (9.1.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
Expand Down Expand Up @@ -37,12 +37,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
Anyline: d076ffac04ccf43a281ac6a6dd5230630c7e260c
anyline_plugin: 1f62863478c6660d2f40144e31e1b74b215ac721
Anyline: 2a4d542643e9bbf0ddfef674a34012d8f866dc2e
anyline_plugin: 5d8b3468299874434c132a1f17bcaf6650151ea9
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78

PODFILE CHECKSUM: 1ba8e470e8138e872af9577a0e261e59d83eaf57

Expand Down
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -407,7 +407,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 53.3.0;
MARKETING_VERSION = 53.0.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 = 53.3.0;
MARKETING_VERSION = 53.0.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 = 53.3.0;
MARKETING_VERSION = 53.0.0;
PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 0 additions & 6 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
<string>NFC Usage</string>
<key>NSCameraUsageDescription</key>
<string>Allow Camera Access to scan with Anyline</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand All @@ -51,9 +49,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
</array>
</dict>
</plist>
Loading

0 comments on commit 2cc8bf1

Please sign in to comment.