2016-07-23 09:48:56 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Bit.App.Controls;
|
|
|
|
|
using Xamarin.Forms;
|
2016-07-24 06:50:08 +03:00
|
|
|
|
using Bit.App.Abstractions;
|
|
|
|
|
using XLabs.Ioc;
|
2016-07-23 09:48:56 +03:00
|
|
|
|
|
|
|
|
|
namespace Bit.App.Pages
|
|
|
|
|
{
|
|
|
|
|
public class SettingsAboutPage : ExtendedContentPage
|
|
|
|
|
{
|
2016-07-24 06:50:08 +03:00
|
|
|
|
private readonly IAppInfoService _appInfoService;
|
|
|
|
|
|
2016-07-23 09:48:56 +03:00
|
|
|
|
public SettingsAboutPage()
|
|
|
|
|
{
|
2016-07-24 06:50:08 +03:00
|
|
|
|
_appInfoService = Resolver.Resolve<IAppInfoService>();
|
2016-07-23 09:48:56 +03:00
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
2016-07-24 06:50:08 +03:00
|
|
|
|
var logo = new Image
|
|
|
|
|
{
|
|
|
|
|
Source = "logo",
|
|
|
|
|
HorizontalOptions = LayoutOptions.Center
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var versionLabel = new Label
|
|
|
|
|
{
|
|
|
|
|
Text = $@"Version {_appInfoService.Version}
|
|
|
|
|
© 8bit Solutions LLC 2015-{DateTime.Now.Year}",
|
|
|
|
|
HorizontalTextAlignment = TextAlignment.Center
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var creditsButton = new Button
|
|
|
|
|
{
|
|
|
|
|
Text = "Credits",
|
|
|
|
|
Style = (Style)Application.Current.Resources["btn-primaryAccent"],
|
|
|
|
|
Margin = new Thickness(15, 0, 15, 25),
|
|
|
|
|
Command = new Command(async () => await Navigation.PushAsync(new SettingsCreditsPage())),
|
|
|
|
|
HorizontalOptions = LayoutOptions.Center
|
|
|
|
|
};
|
2016-07-23 09:48:56 +03:00
|
|
|
|
|
2016-07-24 06:50:08 +03:00
|
|
|
|
var stackLayout = new StackLayout
|
|
|
|
|
{
|
|
|
|
|
Children = { logo, versionLabel, creditsButton },
|
|
|
|
|
VerticalOptions = LayoutOptions.Center,
|
|
|
|
|
Spacing = 20,
|
|
|
|
|
Margin = new Thickness(0, 0, 0, 40)
|
|
|
|
|
};
|
2016-07-23 09:48:56 +03:00
|
|
|
|
|
|
|
|
|
Title = "About bitwarden";
|
2016-07-24 06:50:08 +03:00
|
|
|
|
Content = new ScrollView { Content = stackLayout };
|
|
|
|
|
NavigationPage.SetBackButtonTitle(this, "About");
|
2016-07-23 09:48:56 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|