1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-06 18:43:43 +00:00

added lock fingerprint page. added view for ios to hide app when backgrounded from multitask window.

This commit is contained in:
Kyle Spearrin
2016-05-21 12:32:34 -04:00
parent 54652e639b
commit c408614a85
12 changed files with 451 additions and 215 deletions

View File

@@ -5,6 +5,10 @@ using System.Text;
using Bit.App.Abstractions;
using Bit.App.Pages;
using Xamarin.Forms;
using System.Diagnostics;
using Plugin.Fingerprint.Abstractions;
using System.Threading.Tasks;
using Plugin.Settings.Abstractions;
namespace Bit.App
{
@@ -12,11 +16,19 @@ namespace Bit.App
{
private readonly IDatabaseService _databaseService;
private readonly IAuthService _authService;
private readonly IFingerprint _fingerprint;
private readonly ISettings _settings;
public App(IAuthService authService, IDatabaseService databaseService)
public App(
IAuthService authService,
IDatabaseService databaseService,
IFingerprint fingerprint,
ISettings settings)
{
_databaseService = databaseService;
_authService = authService;
_fingerprint = fingerprint;
_settings = settings;
if(authService.IsAuthenticated)
{
@@ -28,22 +40,40 @@ namespace Bit.App
}
MainPage.BackgroundColor = Color.FromHex("ecf0f5");
MessagingCenter.Subscribe<App>(this, "Lock", async (sender) =>
{
await CheckLockAsync();
});
}
protected override void OnStart()
{
// Handle when your app starts
CheckLockAsync();
_databaseService.CreateTables();
Debug.WriteLine("OnStart");
}
protected override void OnSleep()
{
// Handle when your app sleeps
Debug.WriteLine("OnSleep");
}
protected override void OnResume()
{
// Handle when your app resumes
Debug.WriteLine("OnResume");
}
private async Task CheckLockAsync()
{
if(_authService.IsAuthenticated && Current.MainPage.Navigation.ModalStack.LastOrDefault() as LockFingerprintPage == null)
{
await Current.MainPage.Navigation.PushModalAsync(new LockFingerprintPage(), false);
}
}
}
}