From 149696a110ddc40063af2dfbe3729e76f670bc9a Mon Sep 17 00:00:00 2001 From: igor-graca <80965280+igor-graca@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:54:02 +0200 Subject: [PATCH] Release 9.0.0 (#9) --- MAUI/Anyline.Examples.MAUI.csproj | 18 +- MAUI/MainPage.xaml.cs | 10 +- MAUI/MauiProgram.cs | 4 - MAUI/Models/AnylineScanModes.cs | 5 - MAUI/NFC/MyNFCScanningWithAnylinePage.xaml | 11 - MAUI/NFC/MyNFCScanningWithAnylinePage.xaml.cs | 74 ------- MAUI/NFC/MyScanResults.cs | 45 ---- MAUI/NFC/NFCResultsPage.xaml | 75 ------- MAUI/NFC/NFCResultsPage.xaml.cs | 42 ---- MAUI/NFC/NFCScanExampleView.cs | 40 ---- MAUI/Platforms/Android/AndroidManifest.xml | 4 +- MAUI/Platforms/Android/NFC/NFCScanActivity.cs | 197 ------------------ .../Android/NFC/NFCScanningViewRenderer.cs | 191 ----------------- .../Android/Resources/layout/ActivityNFC.xml | 59 ------ MAUI/Platforms/iOS/Entitlements.plist | 5 - MAUI/Platforms/iOS/Info.plist | 6 - .../iOS/NFC/NFCScanningViewRenderer.cs | 191 ----------------- 17 files changed, 5 insertions(+), 972 deletions(-) delete mode 100644 MAUI/NFC/MyNFCScanningWithAnylinePage.xaml delete mode 100644 MAUI/NFC/MyNFCScanningWithAnylinePage.xaml.cs delete mode 100644 MAUI/NFC/MyScanResults.cs delete mode 100644 MAUI/NFC/NFCResultsPage.xaml delete mode 100644 MAUI/NFC/NFCResultsPage.xaml.cs delete mode 100644 MAUI/NFC/NFCScanExampleView.cs delete mode 100644 MAUI/Platforms/Android/NFC/NFCScanActivity.cs delete mode 100644 MAUI/Platforms/Android/NFC/NFCScanningViewRenderer.cs delete mode 100644 MAUI/Platforms/Android/Resources/layout/ActivityNFC.xml delete mode 100644 MAUI/Platforms/iOS/NFC/NFCScanningViewRenderer.cs diff --git a/MAUI/Anyline.Examples.MAUI.csproj b/MAUI/Anyline.Examples.MAUI.csproj index b7c68c9..860c23f 100644 --- a/MAUI/Anyline.Examples.MAUI.csproj +++ b/MAUI/Anyline.Examples.MAUI.csproj @@ -18,7 +18,7 @@ 9C37433F-9192-4C96-B49A-B9A7E047FBC2 - 8.1.0 + 9.0.0 1 12.0 @@ -70,18 +70,15 @@ - - - - - + + @@ -97,12 +94,6 @@ MSBuild:Compile - - - - - MSBuild:Compile - @@ -116,9 +107,6 @@ - - - diff --git a/MAUI/MainPage.xaml.cs b/MAUI/MainPage.xaml.cs index 40ef362..c6bc7d8 100644 --- a/MAUI/MainPage.xaml.cs +++ b/MAUI/MainPage.xaml.cs @@ -1,5 +1,4 @@ using Anyline.Examples.MAUI.Models; -using Anyline.Examples.MAUI.NFC; using Microsoft.Maui.Controls; using Microsoft.Maui.Controls.PlatformConfiguration; using Microsoft.Maui.Controls.Shapes; @@ -63,14 +62,7 @@ private async void BtScan_Clicked(object sender, EventArgs e) AnylineScanMode scanMode = new AnylineScanMode(name_config[0], name_config[1], string.Empty); - if (scanMode.Name == "Scan NFC of Passports") - { - await Navigation.PushAsync(new MyNFCScanningWithAnylinePage(scanMode)); - } - else - { - await Navigation.PushAsync(new MyScanningWithAnylinePage(scanMode)); - } + await Navigation.PushAsync(new MyScanningWithAnylinePage(scanMode)); (sender as Button).IsEnabled = true; } diff --git a/MAUI/MauiProgram.cs b/MAUI/MauiProgram.cs index 10aff04..870cd57 100644 --- a/MAUI/MauiProgram.cs +++ b/MAUI/MauiProgram.cs @@ -3,17 +3,14 @@ namespace Anyline.Examples.MAUI; -using NFC; using Views; #if ANDROID using Anyline.Examples.MAUI.Platforms.Android.CustomRenderers; -using Anyline.Examples.MAUI.Platforms.Android.NFC; #endif #if IOS using Anyline.Examples.MAUI.Platforms.iOS.CustomRenderers; -using Anyline.Examples.MAUI.Platforms.iOS.NFC; #endif public static class MauiProgram @@ -27,7 +24,6 @@ public static MauiApp CreateMauiApp() { //handlers.AddHandler(typeof(AnylineView), typeof(AnylineHandler)); handlers.AddHandler(typeof(AnylineScanningView), typeof(AnylineScanningViewRenderer)); - handlers.AddHandler(typeof(NFCScanExampleView), typeof(NFCScanningViewRenderer)); }) .ConfigureFonts(fonts => { diff --git a/MAUI/Models/AnylineScanModes.cs b/MAUI/Models/AnylineScanModes.cs index 70a5b51..46e6ecc 100644 --- a/MAUI/Models/AnylineScanModes.cs +++ b/MAUI/Models/AnylineScanModes.cs @@ -48,10 +48,6 @@ public static List GetAnylineScanModesGroupedList() new AnylineScanMode("Serial Scanning (LPT - EU > DVL > VIN)","workflows_config_serial_scanning.json"), new AnylineScanMode("Parallel Scanning (Meter / Serial Number)","workflows_config_parallel_scanning.json"), new AnylineScanMode("Parallel - First Scan (VIN or Barcode)","workflows_config_parallel_first_scan.json") - }), - new AnylineScanModeGroup("NFC", new List - { - new AnylineScanMode("Scan NFC of Passports","id_config_mrz.json") }) }; } @@ -71,7 +67,6 @@ public class AnylineScanMode { public string Name { get; set; } public string JSONConfigPath { get; set; } - public bool IsNFC { get; set; } public AnylineScanMode(string name, string jsonConfigPath, string configsPath = "Configs/") { diff --git a/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml b/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml deleted file mode 100644 index cbc3923..0000000 --- a/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml.cs b/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml.cs deleted file mode 100644 index 0f36388..0000000 --- a/MAUI/NFC/MyNFCScanningWithAnylinePage.xaml.cs +++ /dev/null @@ -1,74 +0,0 @@ - -using Anyline.Examples.MAUI.Models; -using Anyline.Examples.MAUI.Views; -using Anyline.Examples.MAUI.NFC; - -namespace Anyline.Examples.MAUI.NFC; - -/// -/// This is your app's page where Anyline will be integrated. -/// -public partial class MyNFCScanningWithAnylinePage : ContentPage -{ - private AnylineScanMode _scanMode; - private MyScanResults _myScanResults; - - /// - /// The constructor initializes a new "NFCScanExampleView" (which is rendered natively in Android), - /// provides a "myResultAction", which will be called once the scanning process is successfully completed, - /// and a "myErrorAction", which will be called if an error in the process occurs. - /// - /// Object containing the Name of the ScanMode and the JSON config file path (used for initializing the ScanView). - public MyNFCScanningWithAnylinePage(AnylineScanMode scanMode) - { - InitializeComponent(); - _scanMode = scanMode; - - Title = scanMode.Name; - - Action myResultAction = (r) => - { - // save the results in a variable to display them after this page appears again - _myScanResults = r; - }; - - Action myErrorAction = (errorMessage) => - { - MainThread.BeginInvokeOnMainThread(async () => - { - await DisplayAlert("NFC Error", errorMessage, "OK"); - }); - }; - - var view = new NFCScanExampleView(scanMode.JSONConfigPath, myResultAction, myErrorAction); - - gridContent.Add(view); - } - - // Display the NFC results only after we come back to this page - // (the NFC Scanning activities/pages) - protected override void OnAppearing() - { - base.OnAppearing(); - - if (_myScanResults != null) - { - ShowNFCResults(_myScanResults, _scanMode); - } - } - - /// - /// This method is called inside the Action, used to process the Scan Results. - /// - /// The scan results, coming from the native platform. - /// Object containing the Name of the ScanMode and the JSON config file path (used for re-initializing the ScanView page). - private void ShowNFCResults(MyScanResults myScanResults, AnylineScanMode scanMode) - { - MainThread.InvokeOnMainThreadAsync(new Action(async () => - { - // Opens the Results Page to display the MRZ and NFC data - Navigation.InsertPageBefore(new NFCResultsPage(myScanResults, scanMode), Navigation.NavigationStack.Last()); - await Navigation.PopAsync(); - })); - } -} \ No newline at end of file diff --git a/MAUI/NFC/MyScanResults.cs b/MAUI/NFC/MyScanResults.cs deleted file mode 100644 index c67c6b7..0000000 --- a/MAUI/NFC/MyScanResults.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -namespace Anyline.Examples.MAUI.NFC -{ - public class MyScanResults - { - public MyMRZScanResults MRZResults { get; set; } - public MyNFCScanResults NFCResults { get; set; } - } - - public class MyMRZScanResults - { - public byte[] CroppedImage { get; set; } - public byte[] FullImage { get; set; } - public byte[] FaceImage { get; set; } - - public string GivenNames { get; set; } - public string Surname { get; set; } - - public string PassportNumber { get; set; } - public string DateOfBirth { get; set; } - public string DateOfExpiry { get; set; } - } - - public class MyNFCScanResults - { - public byte[] FaceImage { get; set; } - - public string FirstName { get; set; } - public string LastName { get; set; } - public string Gender { get; set; } - public string DocumentNumber { get; set; } - public string DateOfBirth { get; set; } - public string DateOfExpiry { get; set; } - public string DocumentType { get; set; } - public string IssueAuthority { get; set; } - public string IssuingCountryCode { get; set; } - public string Nationality { get; set; } - public string ValidFrom { get; set; } - public string ValidUntil { get; set; } - public string OrganizationalUnit { get; set; } - public string CertificationAuthority { get; set; } - public string IssuerCountry { get; set; } - public string IssuingStateCode { get; set; } - } -} \ No newline at end of file diff --git a/MAUI/NFC/NFCResultsPage.xaml b/MAUI/NFC/NFCResultsPage.xaml deleted file mode 100644 index b4b6e5a..0000000 --- a/MAUI/NFC/NFCResultsPage.xaml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -