1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 07:43:37 +00:00

android back on main pages goes to vault first

This commit is contained in:
Kyle Spearrin
2018-01-08 11:33:51 -05:00
parent 8f77df4ebb
commit 3f1aab27d6
5 changed files with 691 additions and 643 deletions

View File

@@ -18,6 +18,7 @@ namespace Bit.App.Pages
private readonly IGoogleAnalyticsService _googleAnalyticsService;
private readonly Action<string> _passwordValueAction;
private readonly bool _fromAutofill;
private readonly MainPage _mainPage;
public ToolsPasswordGeneratorPage(Action<string> passwordValueAction = null, bool fromAutofill = false)
{
@@ -31,6 +32,12 @@ namespace Bit.App.Pages
Init();
}
public ToolsPasswordGeneratorPage(MainPage mainPage)
: this()
{
_mainPage = mainPage;
}
public PasswordGeneratorPageModel Model { get; private set; } = new PasswordGeneratorPageModel();
public Label Password { get; private set; }
public SliderViewCell SliderCell { get; private set; }
@@ -253,6 +260,17 @@ namespace Bit.App.Pages
SliderCell.Dispose();
}
protected override bool OnBackButtonPressed()
{
if(Device.RuntimePlatform == Device.Android && _mainPage != null)
{
_mainPage.ResetToVaultPage();
return true;
}
return base.OnBackButtonPressed();
}
private void RegenerateCell_Tapped(object sender, EventArgs e)
{
Model.Password = _passwordGenerationService.GeneratePassword();