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

63 lines
1.5 KiB
C#
Raw Normal View History

2016-05-03 00:50:16 +03:00
using System;
using Bit.App.Abstractions;
using Bit.App.Resources;
2016-05-03 00:50:16 +03:00
using Xamarin.Forms;
using XLabs.Ioc;
2016-05-13 04:30:02 +03:00
using Bit.App.Controls;
2016-05-03 00:50:16 +03:00
namespace Bit.App.Pages
{
public class SettingsPage : ContentPage
{
private readonly IAuthService _authService;
2016-05-03 00:50:16 +03:00
public SettingsPage()
{
_authService = Resolver.Resolve<IAuthService>();
Init();
}
private void Init()
{
2016-05-12 00:30:09 +03:00
var foldersCell = new TextCell { Text = "Folders" };
foldersCell.Tapped += FoldersCell_Tapped;
2016-05-13 04:30:02 +03:00
var table = new ExtendedTableView
{
2016-05-13 04:30:02 +03:00
EnableScrolling = false,
2016-05-12 00:30:09 +03:00
Intent = TableIntent.Menu,
Root = new TableRoot
{
new TableSection("Manage Folders")
{
foldersCell
}
}
};
2016-05-03 00:50:16 +03:00
var logoutButton = new Button
{
Text = AppResources.LogOut,
2016-05-03 00:50:16 +03:00
Command = new Command(() =>
{
_authService.LogOut();
2016-05-03 00:50:16 +03:00
Application.Current.MainPage = new LoginNavigationPage();
})
};
var stackLayout = new StackLayout { };
stackLayout.Children.Add(table);
2016-05-03 00:50:16 +03:00
stackLayout.Children.Add(logoutButton);
Title = AppResources.Settings;
2016-05-03 00:50:16 +03:00
Content = stackLayout;
}
private void FoldersCell_Tapped(object sender, EventArgs e)
{
}
2016-05-03 00:50:16 +03:00
}
}