bitwarden-android/src/App/Pages/MainPage.cs

37 lines
1.2 KiB
C#
Raw Normal View History

2016-05-03 00:50:16 +03:00
using System;
2016-05-10 06:25:37 +03:00
using Bit.App.Controls;
2016-05-03 00:50:16 +03:00
using Xamarin.Forms;
2017-11-27 22:41:15 +03:00
using XLabs.Ioc;
using Bit.App.Abstractions;
2016-05-03 00:50:16 +03:00
namespace Bit.App.Pages
{
2016-05-10 06:25:37 +03:00
public class MainPage : ExtendedTabbedPage
2016-05-03 00:50:16 +03:00
{
public MainPage(bool myVault = false)
2016-05-03 00:50:16 +03:00
{
TintColor = Color.FromHex("3c8dbc");
2016-05-10 06:25:37 +03:00
var settingsNavigation = new ExtendedNavigationPage(new SettingsPage());
2017-11-27 22:24:47 +03:00
var favoritesNavigation = new ExtendedNavigationPage(new VaultListCiphersPage(favorites: true));
2017-11-25 07:15:25 +03:00
var vaultNavigation = new ExtendedNavigationPage(new VaultListGroupingsPage());
var toolsNavigation = new ExtendedNavigationPage(new ToolsPage());
favoritesNavigation.Icon = "star.png";
vaultNavigation.Icon = "fa_lock.png";
toolsNavigation.Icon = "tools.png";
settingsNavigation.Icon = "cogs.png";
2016-05-03 00:50:16 +03:00
Children.Add(favoritesNavigation);
2016-05-03 00:50:16 +03:00
Children.Add(vaultNavigation);
Children.Add(toolsNavigation);
2016-05-03 00:50:16 +03:00
Children.Add(settingsNavigation);
2017-11-27 22:41:15 +03:00
if(myVault || Resolver.Resolve<IAppSettingsService>().DefaultPageVault)
{
SelectedItem = vaultNavigation;
}
2016-05-03 00:50:16 +03:00
}
}
}