1
0
mirror of https://github.com/bitwarden/mobile.git synced 2025-02-18 01:31:42 +01:00

New resource strings. TableView implementation for settings page.

This commit is contained in:
Kyle Spearrin 2016-05-08 00:28:14 -04:00
parent 93f1d9ebfb
commit 01b318024b
15 changed files with 72 additions and 9 deletions

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Xamarin.Forms; using Xamarin.Forms;
@ -9,27 +8,68 @@ namespace Bit.App.Pages
{ {
public class SettingsPage : ContentPage public class SettingsPage : ContentPage
{ {
private ListView _listView = new ListView(); private readonly IAuthService _authService;
public SettingsPage() 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 var logoutButton = new Button
{ {
Text = AppResources.LogOut, Text = AppResources.LogOut,
Command = new Command(() => Command = new Command(() =>
{ {
authService.LogOut(); _authService.LogOut();
Application.Current.MainPage = new LoginNavigationPage(); Application.Current.MainPage = new LoginNavigationPage();
}) })
}; };
var stackLayout = new StackLayout { }; var stackLayout = new StackLayout { };
stackLayout.Children.Add(table);
stackLayout.Children.Add(logoutButton); stackLayout.Children.Add(logoutButton);
Title = AppResources.Settings; Title = AppResources.Settings;
Content = stackLayout; Content = stackLayout;
} }
private void FoldersCell_Tapped(object sender, EventArgs e)
{
}
} }
} }

View File

@ -41,7 +41,7 @@ namespace Bit.App.Pages
Title = AppResources.MyVault; Title = AppResources.MyVault;
Content = listView; Content = listView;
NavigationPage.SetBackButtonTitle(this, "Back"); NavigationPage.SetBackButtonTitle(this, AppResources.Back);
} }
protected override void OnAppearing() protected override void OnAppearing()
@ -141,7 +141,7 @@ namespace Bit.App.Pages
{ {
_page = page; _page = page;
Text = AppResources.Add; Text = AppResources.Add;
Icon = "fa-plus"; Icon = "ion-plus";
Clicked += ClickedItem; Clicked += ClickedItem;
} }

View File

@ -119,6 +119,7 @@ namespace Bit.App.Pages
SetBinding(Page.TitleProperty, new Binding("PageTitle")); SetBinding(Page.TitleProperty, new Binding("PageTitle"));
Content = scrollView; Content = scrollView;
BindingContext = Model; BindingContext = Model;
NavigationPage.SetBackButtonTitle(this, AppResources.Back);
} }
protected override void OnAppearing() protected override void OnAppearing()

View File

@ -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> /// <summary>
/// Looks up a localized string similar to Cancel. /// Looks up a localized string similar to Cancel.
/// </summary> /// </summary>

View File

@ -129,6 +129,10 @@
<value>An error has occurred.</value> <value>An error has occurred.</value>
<comment>Alert title when something goes wrong.</comment> <comment>Alert title when something goes wrong.</comment>
</data> </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"> <data name="Cancel" xml:space="preserve">
<value>Cancel</value> <value>Cancel</value>
<comment>Cancel an operation.</comment> <comment>Cancel an operation.</comment>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

View File

@ -243,13 +243,22 @@
<BundleResource Include="Resources\fa-lock%403x.png" /> <BundleResource Include="Resources\fa-lock%403x.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BundleResource Include="Resources\fa-plus.png" /> <BundleResource Include="Resources\ion-chevron-right.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BundleResource Include="Resources\fa-plus%402x.png" /> <BundleResource Include="Resources\ion-chevron-right%402x.png" />
</ItemGroup> </ItemGroup>
<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> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">