Skip to content

Commit

Permalink
Update to Anyline .NET SDK v5.0.0
Browse files Browse the repository at this point in the history
- Anyline Android SDK: v51.1.0

- Anyline iOS SDK: v51.1.0
  • Loading branch information
ricardocolombo committed Oct 12, 2023
1 parent 919c8cf commit 19306c8
Show file tree
Hide file tree
Showing 30 changed files with 387 additions and 782 deletions.
7 changes: 3 additions & 4 deletions MAUI/Anyline.Examples.MAUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ApplicationIdGuid>9C37433F-9192-4C96-B49A-B9A7E047FBC2</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>4.0.0</ApplicationDisplayVersion>
<ApplicationDisplayVersion>5.0.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.0</SupportedOSPlatformVersion>
Expand Down Expand Up @@ -78,8 +78,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Anyline.SDK.NET.Android" Version="4.0.0" />
<PackageReference Include="Anyline.SDK.NET.iOS" Version="4.0.0" />
<PackageReference Include="Anyline.SDK.NET.Android" Version="5.0.0" />
<PackageReference Include="Anyline.SDK.NET.iOS" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

Expand Down Expand Up @@ -111,7 +111,6 @@

<ItemGroup>
<BundleResource Include="Resources\Raw\Configs\vehicle_registration_certificate_config.json" />
<BundleResource Include="Resources\Raw\Configs\others_config_barcode_pdf417_config.json" />
<BundleResource Include="Resources\Raw\Configs\workflows_config_parallel_first_scan.json" />
<BundleResource Include="Resources\Raw\Configs\tire_make_config.json" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion MAUI/Models/AnylineScanModes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public static List<AnylineScanModeGroup> GetAnylineScanModesGroupedList()
}),
new AnylineScanModeGroup("Barcode", new List<AnylineScanMode>{
new AnylineScanMode("Barcode", "others_config_barcode.json"),
new AnylineScanMode("Barcode - PDF417 - AAMVA", "others_config_barcode_pdf417_config.json"),
}),
new AnylineScanModeGroup("Composite", new List<AnylineScanMode>{
new AnylineScanMode("Serial Scanning (LPT - EU > DVL > VIN)","workflows_config_serial_scanning.json"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Android.Widget;
using Anyline.Examples.MAUI.Views;
using IO.Anyline.Camera;
using IO.Anyline.View;
using IO.Anyline2;
using IO.Anyline2.View;
using Java.Util;
Expand Down
14 changes: 5 additions & 9 deletions MAUI/Platforms/Android/Handlers/AnylineHandler.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
using Android.Util;
using Anyline.Examples.MAUI.Platforms.Android;
using IO.Anyline.Camera;
using IO.Anyline.Plugin.ID;
using IO.Anyline.View;
using IO.Anyline2.View;
using Microsoft.Maui.Handlers;

namespace Anyline.Examples.MAUI.Handlers
Expand Down Expand Up @@ -35,16 +34,13 @@ protected override Android.Views.View CreatePlatformView()

_scanView.Init("Configs/usnr_config.json");

// Activates Face Detection if the MRZ Scanner was initialized
(((_scanView.ScanViewPlugin as IdScanViewPlugin)?.ScanPlugin as IdScanPlugin)?.IdConfig as MrzConfig)?.EnableFaceDetection(true);

//_scanView.ScanViewPlugin.AddScanResultListener(new MyScanResultListener());

// handle camera open events
_scanView.CameraOpened += _scanView_CameraOpened;
_scanView.CameraView.CameraOpened += _scanView_CameraOpened;

// handle camera error events
_scanView.CameraError += _scanView_CameraError;
_scanView.CameraView.CameraError += _scanView_CameraError;
}
catch (Exception e)
{
Expand Down Expand Up @@ -81,8 +77,8 @@ protected override void DisconnectHandler(Android.Views.View platformView)
_scanView.Stop();
_scanView.CameraView.ReleaseCamera();
_scanView.Dispose();
_scanView.CameraOpened -= _scanView_CameraOpened;
_scanView.CameraError -= _scanView_CameraError;
_scanView.CameraView.CameraOpened -= _scanView_CameraOpened;
_scanView.CameraView.CameraError -= _scanView_CameraError;
_scanView = null;
}

Expand Down
4 changes: 2 additions & 2 deletions MAUI/Platforms/Android/NFC/NFCScanActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Anyline.Examples.MAUI.Platforms.Android.NFC
{
[Activity(Label = "NFCScanActivity")]
public class NFCScanActivity : Activity, NfcDetector.INfcDetectionHandler
public class NFCScanActivity : Activity, INfcDetectionHandler
{
protected NfcAdapter mNfcAdapter;

Expand Down Expand Up @@ -74,7 +74,7 @@ protected override void OnResume()

mNfcAdapter.EnableForegroundDispatch(
this,
PendingIntent.GetActivity(this, 0, intent, 0),
PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.Mutable),
new[] { new IntentFilter(NfcAdapter.ActionTechDiscovered) },
new string[][] {
new string[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public override void SubviewAdded(UIView uiview)
private void StartAnylineScanner()
{
NSError error = null;

if(_scanView == null){
System.Diagnostics.Debug.WriteLine("ScanView is null and could not be started");
return;
}

var success = _scanView.ScanViewPlugin.StartWithError(out error);
if (!success)
{
Expand Down
10 changes: 1 addition & 9 deletions MAUI/Platforms/iOS/NFC/NFCScanningViewRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using Anyline.Examples.MAUI.NFC;
using Anyline.Examples.MAUI.Platforms.iOS;
using Anyline.Examples.MAUI.Platforms.iOS.NFC;
using Anyline.Examples.MAUI.NFC;
using Microsoft.Maui.Controls.Handlers.Compatibility;
using Microsoft.Maui.Controls.Platform;
using CoreGraphics;
using Foundation;
using UIKit;
using Anyline.SDK.NET.iOS;
Expand All @@ -13,9 +8,6 @@ namespace Anyline.Examples.MAUI.Platforms.iOS.NFC
{
public class NFCScanningViewRenderer : ViewRenderer, IALScanPluginDelegate, IALNFCDetectorDelegate
{
private CGRect frame;
private bool initialized;

private ALScanView _scanView;

ALNFCDetector _nfcDetector;
Expand Down
48 changes: 24 additions & 24 deletions MAUI/Resources/Raw/Configs/energy_analog_digital_config.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"cameraConfig": {
"captureResolution": "1080p",
"pictureResolution": "1080p"
"captureResolution": "720p",
"pictureResolution": "720p"
},
"flashConfig": {
"mode": "manual_off",
"alignment": "top_left"
"mode": "manual",
"alignment": "top_right"
},
"viewPluginConfig": {
"pluginConfig": {
"id": "com.anyline.configs.plugin.auto-meter",
"id": "Meter|Analog/Digital Auto",
"meterConfig": {
"scanMode": "auto_analog_digital_meter"
},
"cancelOnResult": true
},
"cutoutConfig": {
"style": "rect",
"maxWidthPercent": "100%",
"width": 768,
"alignment": "top_half",
"alignment": "top",
"strokeWidth": 2,
"strokeColor": "FFFFFF",
"cornerRadius": 4,
"outerColor": "000000",
"outerAlpha": 0.5,
"feedbackStrokeColor": "0099FF",
"maxWidthPercent": "85%",
"maxHeightPercent": "85%",
"ratioFromSize": {
"width": 9,
"height": 4
"width": 2,
"height": 1
},
"offset": {
"x": 0,
"y": 80
},
"strokeWidth": 2,
"cornerRadius": 4,
"strokeColor": "0099FF",
"outerColor": "000000",
"outerAlpha": 0.3
"y": 120
}
},
"scanFeedbackConfig": {
"style": "contour_rect",
"strokeWidth": 2,
"style": "CONTOUR_RECT",
"strokeColor": "0099FF",
"strokeWidth": 2,
"fillColor": "220099FF",
"cornerRadius": 2,
"beepOnResult": true,
"vibrateOnResult": true,
"blinkAnimationOnResult": true,
"redrawTimeout": 200,
"animationDuration": 75
"animationDuration": 75,
"blinkAnimationOnResult": true,
"beepOnResult": true,
"vibrateOnResult": true
}
}
}
9 changes: 4 additions & 5 deletions MAUI/Resources/Raw/Configs/energy_dial_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"flashConfig": {
"mode": "auto",
"alignment": "bottom_right"
"alignment": "top_right"
},
"viewPluginConfig": {
"pluginConfig": {
Expand All @@ -15,18 +15,17 @@
"cancelOnResult": true
},
"cutoutConfig": {
"style": "contour_rect",
"alignment": "top",
"strokeWidth": 2,
"strokeColor": "FFFFFF",
"cornerRadius": 4,
"outerColor": "000000",
"outerAlpha": 0.5,
"feedbackStrokeColor": "0099FF",
"maxWidthPercent": "90%",
"maxHeightPercent": "90%",
"maxWidthPercent": "85%",
"maxHeightPercent": "85%",
"ratioFromSize": {
"width": 2.25,
"width": 2,
"height": 1
},
"offset": {
Expand Down
Loading

0 comments on commit 19306c8

Please sign in to comment.