Skip to content

Commit

Permalink
Merge pull request #47 from BlinkID/release/5.4.0
Browse files Browse the repository at this point in the history
Release/5.4.0
  • Loading branch information
i1E authored Apr 30, 2020
2 parents ba4bca8 + bad0945 commit 5358e0c
Show file tree
Hide file tree
Showing 98 changed files with 3,261 additions and 8,071 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ Thumbs.db

# dotCover
*.dotCover

clean.sh
6 changes: 3 additions & 3 deletions Binding/Android/AndroidBinding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidClassParser>class-parse</AndroidClassParser>
<PackageId>BlinkID.Android.Binding</PackageId>
<PackageVersion>5.3.0</PackageVersion>
<PackageVersion>5.4.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
<PackageReleaseNotes>Updated to BlinkID Android SDK v5.3.0
<PackageReleaseNotes>Updated to BlinkID Android SDK v5.4.0

https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0</PackageReleaseNotes>
https://github.com/BlinkID/blinkid-android/releases/tag/v5.4.0</PackageReleaseNotes>
<Summary>A small, but powerful ID scanning library - native Android SDK binding package.</Summary>
<Title>BlinkID</Title>
<Description>A small, but powerful ID scanning library - native Android SDK binding package.</Description>
Expand Down
4 changes: 2 additions & 2 deletions Binding/Android/Jars/LibBlinkID.aar
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<PackageId>BlinkID.Forms.Android</PackageId>
<PackageVersion>5.3.0</PackageVersion>
<PackageVersion>5.4.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
Expand All @@ -23,9 +23,9 @@
<Description>A small, but powerful ID scanning library - Android implementation for Xamarin Forms.</Description>
<ReleaseVersion>4.0.0</ReleaseVersion>
<PackOnBuild>true</PackOnBuild>
<PackageReleaseNotes>Updated for BlinkID Android SDK v5.3.0
<PackageReleaseNotes>Updated for BlinkID Android SDK v5.4.0

https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0</PackageReleaseNotes>
https://github.com/BlinkID/blinkid-android/releases/tag/v5.4.0</PackageReleaseNotes>
<!-- Workaround for build error -->
<DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>
Expand Down Expand Up @@ -192,6 +192,7 @@ https://github.com/BlinkID/blinkid-android/releases/tag/v5.3.0</PackageReleaseNo
<ItemGroup>
<Compile Include="MicroblinkScannerImplementation.cs" />
<Compile Include="Overlays/OverlaySettings.cs" />
<Compile Include="Overlays/RecognizerCollectionOverlaySettings.cs" />
<Compile Include="Overlays/Implementations/BlinkIdOverlaySettings.cs" />
<Compile Include="Overlays/Implementations/DocumentOverlaySettings.cs" />
<Compile Include="Overlays/Implementations/DocumentVerificationOverlaySettings.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Xamarin.Forms;
using Microblink.Forms.Core;
using Microblink.Forms.Core.Overlays;
using Microblink.Forms.Core.Recognizers;
using Com.Microblink;
using Com.Microblink.Uisettings;
using Microblink.Forms.Droid.Overlays;
Expand Down Expand Up @@ -68,7 +69,10 @@ public void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
if (resultCode == Result.Ok)
{
recognizerBundle.LoadFromIntent(data);
if (recognizerBundle != null)
{
recognizerBundle.LoadFromIntent(data);
}
MessagingCenter.Send(new Messages.ScanningDoneMessage { ScanningCancelled = false }, Messages.ScanningDoneMessageId);
}
else
Expand All @@ -83,7 +87,8 @@ public void Scan(IOverlaySettings overlaySettings)
androidHostActivity.ScanningStarted(this);
var aOverlaySettings = (OverlaySettings)overlaySettings;
// assume given recognizerColelction was also used for constructing overlaySettings
recognizerBundle = ((RecognizerCollection)aOverlaySettings.RecognizerCollection).NativeRecognizerBundle;
recognizerBundle = ((RecognizerCollection)((RecognizerCollectionOverlaySettings)aOverlaySettings).RecognizerCollection).NativeRecognizerBundle;

ActivityRunner.StartActivityForResult(androidHostActivity.HostActivity, androidHostActivity.ScanActivityRequestCode, ((OverlaySettings)overlaySettings).NativeUISettings);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: Xamarin.Forms.Dependency(typeof(BlinkIdOverlaySettingsFactory))]
namespace Microblink.Forms.Droid.Overlays
{
public sealed class BlinkIdOverlaySettings : OverlaySettings, IBlinkIdOverlaySettings
public sealed class BlinkIdOverlaySettings : RecognizerCollectionOverlaySettings, IBlinkIdOverlaySettings
{
public override UISettings NativeUISettings {
get {
Expand Down Expand Up @@ -52,9 +52,15 @@ public override UISettings NativeUISettings {
if (RecognitionTimeoutMessage != null) {
overlayStringsBuilder.SetRecognitionTimeoutMessage(RecognitionTimeoutMessage);
}
if (RetryButtonText != null) {
if (RetryButtonText != null) {
overlayStringsBuilder.SetRetryButtonText(RetryButtonText);
}
if (ScanBarcodeText != null) {
overlayStringsBuilder.SetBackSideBarcodeInstructions(ScanBarcodeText);
}
if (ErrorDocumentTooCloseToEdge != null) {
overlayStringsBuilder.SetErrorDocumentTooCloseToEdge(ErrorDocumentTooCloseToEdge);
}
concreteUISettings.SetStrings(overlayStringsBuilder.Build());
return concreteUISettings;
}
Expand Down Expand Up @@ -82,6 +88,10 @@ public override UISettings NativeUISettings {

public string RetryButtonText { get; set; }

public string ScanBarcodeText { get; set; }

public string ErrorDocumentTooCloseToEdge { get; set; }

public bool RequireDocumentSidesDataMatch { get; set; } = true;

public bool ShowNotSupportedDialog { get; set; } = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Droid.Recognizers;
using Microblink.Forms.Core.Overlays;
using Microblink.Forms.Core.Recognizers;
Expand All @@ -7,9 +7,9 @@
[assembly: Xamarin.Forms.Dependency(typeof(DocumentOverlaySettingsFactory))]
namespace Microblink.Forms.Droid.Overlays
{
public sealed class DocumentOverlaySettings : OverlaySettings, IDocumentOverlaySettings
public sealed class DocumentOverlaySettings : RecognizerCollectionOverlaySettings, IDocumentOverlaySettings
{
public DocumentOverlaySettings(IRecognizerCollection recognizerCollection)
public DocumentOverlaySettings(IRecognizerCollection recognizerCollection)
: base(new DocumentUISettings((recognizerCollection as RecognizerCollection).NativeRecognizerBundle), recognizerCollection)
{}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: Xamarin.Forms.Dependency(typeof(DocumentVerificationOverlaySettingsFactory))]
namespace Microblink.Forms.Droid.Overlays.Implementations
{
public sealed class DocumentVerificationOverlaySettings : OverlaySettings, IDocumentVerificationOverlaySettings
public sealed class DocumentVerificationOverlaySettings : RecognizerCollectionOverlaySettings, IDocumentVerificationOverlaySettings
{
public override UISettings NativeUISettings {
get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Core.Overlays;
using Microblink.Forms.Core.Recognizers;
using Com.Microblink.Uisettings;
Expand All @@ -16,12 +16,9 @@ public virtual UISettings NativeUISettings {
}
}

public IRecognizerCollection RecognizerCollection { get; }

protected OverlaySettings(UISettings nativeUISettings, IRecognizerCollection recognizerCollection)
protected OverlaySettings(UISettings nativeUISettings)
{
_nativeUISEttings = nativeUISettings;
RecognizerCollection = recognizerCollection;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

using Microblink.Forms.Droid.Overlays;
using Microblink.Forms.Core.Overlays;
using Microblink.Forms.Core.Recognizers;
using Com.Microblink.Uisettings;

namespace Microblink.Forms.Droid.Overlays
{
public abstract class RecognizerCollectionOverlaySettings : OverlaySettings
{
public IRecognizerCollection RecognizerCollection { get; }

protected RecognizerCollectionOverlaySettings(UISettings nativeUISettings, IRecognizerCollection recognizerCollection)
: base(nativeUISettings)
{
RecognizerCollection = recognizerCollection;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public IImageExtensionFactors FullDocumentImageExtensionFactors
set => nativeRecognizer.FullDocumentImageExtensionFactors = (value as ImageExtensionFactors).NativeImageExtensionFactors;
}

public float PaddingEdge
{
get => nativeRecognizer.PaddingEdge;
set => nativeRecognizer.PaddingEdge = value;
}

public bool ReturnFaceImage
{
get => nativeRecognizer.ShouldReturnFaceImage();
Expand All @@ -75,6 +81,12 @@ public bool SignResult
set => nativeRecognizer.SetSignResult(value);
}

public bool SkipUnsupportedBack
{
get => nativeRecognizer.ShouldSkipUnsupportedBack();
set => nativeRecognizer.SetSkipUnsupportedBack(value);
}

}

public sealed class BlinkIdCombinedRecognizerResult : RecognizerResult, IBlinkIdCombinedRecognizerResult
Expand All @@ -88,6 +100,8 @@ internal BlinkIdCombinedRecognizerResult(Com.Microblink.Entities.Recognizers.Bli
public string AdditionalAddressInformation => nativeResult.AdditionalAddressInformation;
public string AdditionalNameInformation => nativeResult.AdditionalNameInformation;
public string Address => nativeResult.Address;
public int Age => (int)nativeResult.Age;
public IClassInfo ClassInfo => nativeResult.ClassInfo != null ? new ClassInfo(nativeResult.ClassInfo) : null;
public string Conditions => nativeResult.Conditions;
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
Expand All @@ -96,7 +110,9 @@ internal BlinkIdCombinedRecognizerResult(Com.Microblink.Entities.Recognizers.Bli
public byte[] DigitalSignature => nativeResult.GetDigitalSignature();
public uint DigitalSignatureVersion => (uint)nativeResult.DigitalSignatureVersion;
public string DocumentAdditionalNumber => nativeResult.DocumentAdditionalNumber;
public DocumentImageColorStatus DocumentBackImageColorStatus => (DocumentImageColorStatus)nativeResult.DocumentBackImageColorStatus.Ordinal();
public DataMatchResult DocumentDataMatch => (DataMatchResult)nativeResult.DocumentDataMatch.Ordinal();
public DocumentImageColorStatus DocumentFrontImageColorStatus => (DocumentImageColorStatus)nativeResult.DocumentFrontImageColorStatus.Ordinal();
public string DocumentNumber => nativeResult.DocumentNumber;
public IDriverLicenseDetailedInfo DriverLicenseDetailedInfo => new DriverLicenseDetailedInfo(nativeResult.DriverLicenseDetailedInfo);
public string Employer => nativeResult.Employer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public IImageExtensionFactors FullDocumentImageExtensionFactors
set => nativeRecognizer.FullDocumentImageExtensionFactors = (value as ImageExtensionFactors).NativeImageExtensionFactors;
}

public float PaddingEdge
{
get => nativeRecognizer.PaddingEdge;
set => nativeRecognizer.PaddingEdge = value;
}

public bool ReturnFaceImage
{
get => nativeRecognizer.ShouldReturnFaceImage();
Expand All @@ -82,12 +88,15 @@ internal BlinkIdRecognizerResult(Com.Microblink.Entities.Recognizers.Blinkid.Gen
public string AdditionalAddressInformation => nativeResult.AdditionalAddressInformation;
public string AdditionalNameInformation => nativeResult.AdditionalNameInformation;
public string Address => nativeResult.Address;
public int Age => (int)nativeResult.Age;
public IClassInfo ClassInfo => nativeResult.ClassInfo != null ? new ClassInfo(nativeResult.ClassInfo) : null;
public string Conditions => nativeResult.Conditions;
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
public bool DateOfExpiryPermanent => nativeResult.IsDateOfExpiryPermanent;
public IDate DateOfIssue => nativeResult.DateOfIssue.Date != null ? new Date(nativeResult.DateOfIssue.Date) : null;
public string DocumentAdditionalNumber => nativeResult.DocumentAdditionalNumber;
public DocumentImageColorStatus DocumentImageColorStatus => (DocumentImageColorStatus)nativeResult.DocumentImageColorStatus.Ordinal();
public string DocumentNumber => nativeResult.DocumentNumber;
public IDriverLicenseDetailedInfo DriverLicenseDetailedInfo => new DriverLicenseDetailedInfo(nativeResult.DriverLicenseDetailedInfo);
public string Employer => nativeResult.Employer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal IdBarcodeRecognizerResult(Com.Microblink.Entities.Recognizers.Blinkid.I
public string AdditionalAddressInformation => nativeResult.AdditionalAddressInformation;
public string AdditionalNameInformation => nativeResult.AdditionalNameInformation;
public string Address => nativeResult.Address;
public int Age => (int)nativeResult.Age;
public BarcodeType BarcodeType => (BarcodeType)nativeResult.BarcodeType.Ordinal();
public IDate DateOfBirth => nativeResult.DateOfBirth.Date != null ? new Date(nativeResult.DateOfBirth.Date) : null;
public IDate DateOfExpiry => nativeResult.DateOfExpiry.Date != null ? new Date(nativeResult.DateOfExpiry.Date) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public string GetField(UsdlKeys key)

public string Sex => nativeResult.Sex;

public int Age => nativeResult.Age;

public string Restrictions => nativeResult.Restrictions;

public string Endorsements => nativeResult.Endorsements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public string GetField(UsdlKeys key)

public string Sex => nativeResult.Sex;

public int Age => nativeResult.Age;

public string Restrictions => nativeResult.Restrictions;

public string Endorsements => nativeResult.Endorsements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public MrzResult(Com.Microblink.Entities.Recognizers.Blinkid.Mrtd.MrzResult nati

public IDate DateOfBirth => nativeMrzResult.DateOfBirth.Date != null ? new Date(nativeMrzResult.DateOfBirth.Date) : null;

public int Age => nativeMrzResult.Age;

public string DocumentNumber => nativeMrzResult.DocumentNumber;

public string Nationality => nativeMrzResult.Nationality;
Expand Down Expand Up @@ -102,4 +104,22 @@ public IImageExtensionFactors CreateImageExtensionFactors(float upFactor = 0, fl
return new ImageExtensionFactors(new Com.Microblink.Entities.Recognizers.Blinkid.Imageoptions.Extension.ImageExtensionFactors(upFactor, downFactor, leftFactor, rightFactor));
}
}

public sealed class ClassInfo : IClassInfo
{
Com.Microblink.Entities.Recognizers.Blinkid.Generic.Classinfo.ClassInfo nativeClassInfo;

public ClassInfo(Com.Microblink.Entities.Recognizers.Blinkid.Generic.Classinfo.ClassInfo nativeClassInfo)
{
this.nativeClassInfo = nativeClassInfo;
}


public Country Country => (Country)nativeClassInfo.Country.Ordinal();

public Region Region => (Region)nativeClassInfo.Region.Ordinal();

public Type Type => (Type)nativeClassInfo.Type.Ordinal();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<TargetFramework>netstandard1.0</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageId>BlinkID.Forms.Core</PackageId>
<PackageVersion>5.3.0</PackageVersion>
<PackageVersion>5.4.0</PackageVersion>
<Authors>Microblink</Authors>
<Owners>Microblink</Owners>
<PackageProjectUrl>https://github.com/blinkid/blinkid-xamarin</PackageProjectUrl>
<PackageReleaseNotes>Updated for BlinkID Android and iOS SDKs v5.3.0</PackageReleaseNotes>
<PackageReleaseNotes>Updated for BlinkID Android and iOS SDKs v5.4.0</PackageReleaseNotes>
<Summary>A small, but powerful ID scanning library - abstractions library for Xamarin Forms.</Summary>
<Title>BlinkID</Title>
<Description>A small, but powerful ID scanning library - abstractions library for Xamarin Forms.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ public interface IBlinkIdOverlaySettings : IOverlaySettings
/// Default 17000.
/// </summary>
long BackSideScanningTimeoutMilliseconds { get; set; }
/// <summary>
/// Message that is shown while scanning the barcode.
/// If null, default value will be used.
/// </summary>
string ScanBarcodeText { get; set; }
/// <summary>
/// Instructions for the user to move the document from the edge.
/// If null, default value will be used.
/// </summary>
string ErrorDocumentTooCloseToEdge { get; set; }


}

Expand Down
Loading

0 comments on commit 5358e0c

Please sign in to comment.