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

new tab page from code

This commit is contained in:
Kyle Spearrin
2019-05-14 09:43:46 -04:00
parent df802152d7
commit 4f4c6064db
8 changed files with 75 additions and 68 deletions

48
src/App/Pages/TabsPage.cs Normal file
View File

@@ -0,0 +1,48 @@
using Bit.App.Resources;
using Xamarin.Forms;
namespace Bit.App.Pages
{
public class TabsPage : TabbedPage
{
public TabsPage()
{
var groupingsPage = new NavigationPage(new GroupingsPage())
{
Title = AppResources.MyVault,
Icon = "lock.png"
};
Children.Add(groupingsPage);
var generatorPage = new NavigationPage(new GeneratorPage(true, null))
{
Title = AppResources.Generator,
Icon = "refresh.png"
};
Children.Add(generatorPage);
var settingsPage = new NavigationPage(new SettingsPage())
{
Title = AppResources.Settings,
Icon = "cogs.png"
};
Children.Add(settingsPage);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetToolbarPlacement(this,
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Bottom);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false);
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSmoothScrollEnabled(this, false);
}
protected async override void OnCurrentPageChanged()
{
if(CurrentPage is NavigationPage navPage)
{
if(navPage.RootPage is GeneratorPage genPage)
{
await genPage.InitAsync();
}
}
}
}
}