1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

back button to groupings page on android

This commit is contained in:
Kyle Spearrin
2019-05-31 14:15:37 -04:00
parent fc0d91d3e7
commit 582799464f
3 changed files with 37 additions and 7 deletions

View File

@@ -9,9 +9,11 @@ namespace Bit.App.Pages
private GeneratorPageViewModel _vm;
private readonly bool _fromTabPage;
private readonly Action<string> _selectAction;
private readonly TabsPage _tabsPage;
public GeneratorPage(bool fromTabPage, Action<string> selectAction = null)
public GeneratorPage(bool fromTabPage, Action<string> selectAction = null, TabsPage tabsPage = null)
{
_tabsPage = tabsPage;
InitializeComponent();
_vm = BindingContext as GeneratorPageViewModel;
_vm.Page = this;
@@ -37,6 +39,16 @@ namespace Bit.App.Pages
}
}
protected override bool OnBackButtonPressed()
{
if(Device.RuntimePlatform == Device.Android && _tabsPage != null)
{
_tabsPage.ResetToVaultPage();
return true;
}
return base.OnBackButtonPressed();
}
private async void Regenerate_Clicked(object sender, EventArgs e)
{
await _vm.RegenerateAsync();