New resource strings. TableView implementation for settings page.
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Resources;
|
||||
using Xamarin.Forms;
|
||||
@ -9,27 +8,68 @@ namespace Bit.App.Pages
|
||||
{
|
||||
public class SettingsPage : ContentPage
|
||||
{
|
||||
private ListView _listView = new ListView();
|
||||
private readonly IAuthService _authService;
|
||||
|
||||
public SettingsPage()
|
||||
{
|
||||
var authService = Resolver.Resolve<IAuthService>();
|
||||
_authService = Resolver.Resolve<IAuthService>();
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
var foldersLayout = new StackLayout { Orientation = StackOrientation.Horizontal };
|
||||
foldersLayout.Children.Add(new Label
|
||||
{
|
||||
Text = "Folders",
|
||||
HorizontalOptions = LayoutOptions.StartAndExpand,
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(10, 0, 0, 0)
|
||||
});
|
||||
foldersLayout.Children.Add(new Image
|
||||
{
|
||||
Source = ImageSource.FromFile("ion-chevron-right.png"),
|
||||
Opacity = 0.3,
|
||||
HorizontalOptions = LayoutOptions.End,
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(0, 0, 10, 0)
|
||||
});
|
||||
var foldersCell = new ViewCell { View = foldersLayout };
|
||||
foldersCell.Tapped += FoldersCell_Tapped;
|
||||
|
||||
var table = new TableView
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
new TableSection("Manage Folders")
|
||||
{
|
||||
foldersCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var logoutButton = new Button
|
||||
{
|
||||
Text = AppResources.LogOut,
|
||||
Command = new Command(() =>
|
||||
{
|
||||
authService.LogOut();
|
||||
_authService.LogOut();
|
||||
Application.Current.MainPage = new LoginNavigationPage();
|
||||
})
|
||||
};
|
||||
|
||||
var stackLayout = new StackLayout { };
|
||||
stackLayout.Children.Add(table);
|
||||
stackLayout.Children.Add(logoutButton);
|
||||
|
||||
Title = AppResources.Settings;
|
||||
Content = stackLayout;
|
||||
}
|
||||
|
||||
private void FoldersCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace Bit.App.Pages
|
||||
|
||||
Title = AppResources.MyVault;
|
||||
Content = listView;
|
||||
NavigationPage.SetBackButtonTitle(this, "Back");
|
||||
NavigationPage.SetBackButtonTitle(this, AppResources.Back);
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
@ -141,7 +141,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
_page = page;
|
||||
Text = AppResources.Add;
|
||||
Icon = "fa-plus";
|
||||
Icon = "ion-plus";
|
||||
Clicked += ClickedItem;
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,7 @@ namespace Bit.App.Pages
|
||||
SetBinding(Page.TitleProperty, new Binding("PageTitle"));
|
||||
Content = scrollView;
|
||||
BindingContext = Model;
|
||||
NavigationPage.SetBackButtonTitle(this, AppResources.Back);
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
|
9
src/App/Resources/AppResources.Designer.cs
generated
@ -88,6 +88,15 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Back.
|
||||
/// </summary>
|
||||
internal static string Back {
|
||||
get {
|
||||
return ResourceManager.GetString("Back", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
|
@ -129,6 +129,10 @@
|
||||
<value>An error has occurred.</value>
|
||||
<comment>Alert title when something goes wrong.</comment>
|
||||
</data>
|
||||
<data name="Back" xml:space="preserve">
|
||||
<value>Back</value>
|
||||
<comment>Navigate back to the previous screen.</comment>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
<comment>Cancel an operation.</comment>
|
||||
|
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 418 B |
BIN
src/iOS/Resources/ion-chevron-right.png
Normal file
After Width: | Height: | Size: 261 B |
BIN
src/iOS/Resources/ion-chevron-right@2x.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
src/iOS/Resources/ion-chevron-right@3x.png
Normal file
After Width: | Height: | Size: 595 B |
BIN
src/iOS/Resources/ion-plus.png
Normal file
After Width: | Height: | Size: 127 B |
BIN
src/iOS/Resources/ion-plus@2x.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
src/iOS/Resources/ion-plus@3x.png
Normal file
After Width: | Height: | Size: 147 B |
@ -243,13 +243,22 @@
|
||||
<BundleResource Include="Resources\fa-lock%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\fa-plus.png" />
|
||||
<BundleResource Include="Resources\ion-chevron-right.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\fa-plus%402x.png" />
|
||||
<BundleResource Include="Resources\ion-chevron-right%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\fa-plus%403x.png" />
|
||||
<BundleResource Include="Resources\ion-chevron-right%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\ion-plus.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\ion-plus%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\ion-plus%403x.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|