mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
lock page work with autofill
This commit is contained in:
parent
3c58775ae2
commit
29951207ec
3 changed files with 27 additions and 5 deletions
|
@ -174,7 +174,7 @@ namespace Bit.App
|
|||
{
|
||||
if(await _lockService.IsLockedAsync())
|
||||
{
|
||||
Current.MainPage = new NavigationPage(new LockPage());
|
||||
Current.MainPage = new NavigationPage(new LockPage(_appOptions));
|
||||
}
|
||||
else if(_appOptions.FromAutofillFramework && _appOptions.SaveType.HasValue)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Bit.App.Models;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
@ -6,13 +7,32 @@ namespace Bit.App.Pages
|
|||
{
|
||||
public partial class LockPage : BaseContentPage
|
||||
{
|
||||
private LockPageViewModel _vm;
|
||||
private readonly AppOptions _appOptions;
|
||||
private readonly LockPageViewModel _vm;
|
||||
|
||||
public LockPage()
|
||||
public LockPage(AppOptions appOptions = null)
|
||||
{
|
||||
_appOptions = appOptions;
|
||||
InitializeComponent();
|
||||
_vm = BindingContext as LockPageViewModel;
|
||||
_vm.Page = this;
|
||||
_vm.UnlockedAction = () =>
|
||||
{
|
||||
if(_appOptions != null)
|
||||
{
|
||||
if(_appOptions.FromAutofillFramework && _appOptions.SaveType.HasValue)
|
||||
{
|
||||
Application.Current.MainPage = new NavigationPage(new AddEditPage(appOptions: _appOptions));
|
||||
return;
|
||||
}
|
||||
else if(_appOptions.Uri != null)
|
||||
{
|
||||
Application.Current.MainPage = new NavigationPage(new AutofillCiphersPage(_appOptions));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Application.Current.MainPage = new TabsPage();
|
||||
};
|
||||
MasterPasswordEntry = _masterPassword;
|
||||
PinEntry = _pin;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Bit.App.Abstractions;
|
||||
using Bit.App.Models;
|
||||
using Bit.App.Resources;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Abstractions;
|
||||
|
@ -90,6 +91,7 @@ namespace Bit.App.Pages
|
|||
public string ShowPasswordIcon => ShowPassword ? "" : "";
|
||||
public string MasterPassword { get; set; }
|
||||
public string Pin { get; set; }
|
||||
public Action UnlockedAction { get; set; }
|
||||
|
||||
public async Task InitAsync()
|
||||
{
|
||||
|
@ -251,7 +253,7 @@ namespace Bit.App.Pages
|
|||
private void DoContinue()
|
||||
{
|
||||
_messagingService.Send("unlocked");
|
||||
Application.Current.MainPage = new TabsPage();
|
||||
UnlockedAction?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue