1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-13 23:03:23 +00:00

Setup lock apge segues from site list VC. Implemented touchid checking in lock fingerprint VC.

This commit is contained in:
Kyle Spearrin
2016-07-19 23:04:37 -04:00
parent 4f9740043b
commit 7fb51b5aa4
3 changed files with 62 additions and 7 deletions

View File

@@ -5,12 +5,15 @@ using XLabs.Ioc;
using Plugin.Settings.Abstractions;
using Foundation;
using MobileCoreServices;
using Plugin.Fingerprint.Abstractions;
using System.Threading.Tasks;
namespace Bit.iOS.Extension
{
public partial class LockFingerprintViewController : UIViewController
{
private ISettings _settings;
private IFingerprint _fingerprint;
public LockFingerprintViewController(IntPtr handle) : base(handle)
{ }
@@ -27,14 +30,30 @@ namespace Bit.iOS.Extension
public override void ViewDidLoad()
{
_settings = Resolver.Resolve<ISettings>();
_fingerprint = Resolver.Resolve<IFingerprint>();
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
var descriptor = UIFontDescriptor.PreferredBody;
UseButton.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
UseButton.BackgroundColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
UseButton.TintColor = UIColor.White;
UseButton.TouchUpInside += UseButton_TouchUpInside;
base.ViewDidLoad();
}
private void UseButton_TouchUpInside(object sender, EventArgs e)
{
var task = CheckFingerprintAsync();
}
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
var task = CheckFingerprintAsync();
}
partial void CancelButton_Activated(UIBarButtonItem sender)
{
CompleteRequest();
@@ -48,5 +67,14 @@ namespace Bit.iOS.Extension
Context.ExtContext.CompleteRequest(returningItems, null);
}
public async Task CheckFingerprintAsync()
{
var result = await _fingerprint.AuthenticateAsync("Use your fingerprint to verify.");
if(result.Authenticated)
{
DismissModalViewController(true);
}
}
}
}