From 01b318024b5709984410c5906e2e35e96ed0e632 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sun, 8 May 2016 00:28:14 -0400 Subject: [PATCH] New resource strings. TableView implementation for settings page. --- src/App/Pages/SettingsPage.cs | 48 +++++++++++++++++++-- src/App/Pages/VaultListPage.cs | 4 +- src/App/Pages/VaultViewSitePage.cs | 1 + src/App/Resources/AppResources.Designer.cs | 9 ++++ src/App/Resources/AppResources.resx | 4 ++ src/iOS/Resources/fa-plus.png | Bin 242 -> 0 bytes src/iOS/Resources/fa-plus@2x.png | Bin 335 -> 0 bytes src/iOS/Resources/fa-plus@3x.png | Bin 418 -> 0 bytes src/iOS/Resources/ion-chevron-right.png | Bin 0 -> 261 bytes src/iOS/Resources/ion-chevron-right@2x.png | Bin 0 -> 515 bytes src/iOS/Resources/ion-chevron-right@3x.png | Bin 0 -> 595 bytes src/iOS/Resources/ion-plus.png | Bin 0 -> 127 bytes src/iOS/Resources/ion-plus@2x.png | Bin 0 -> 134 bytes src/iOS/Resources/ion-plus@3x.png | Bin 0 -> 147 bytes src/iOS/iOS.csproj | 15 +++++-- 15 files changed, 72 insertions(+), 9 deletions(-) delete mode 100644 src/iOS/Resources/fa-plus.png delete mode 100644 src/iOS/Resources/fa-plus@2x.png delete mode 100644 src/iOS/Resources/fa-plus@3x.png create mode 100644 src/iOS/Resources/ion-chevron-right.png create mode 100644 src/iOS/Resources/ion-chevron-right@2x.png create mode 100644 src/iOS/Resources/ion-chevron-right@3x.png create mode 100644 src/iOS/Resources/ion-plus.png create mode 100644 src/iOS/Resources/ion-plus@2x.png create mode 100644 src/iOS/Resources/ion-plus@3x.png diff --git a/src/App/Pages/SettingsPage.cs b/src/App/Pages/SettingsPage.cs index d3e6d504d..be3cca332 100644 --- a/src/App/Pages/SettingsPage.cs +++ b/src/App/Pages/SettingsPage.cs @@ -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(); + _authService = Resolver.Resolve(); + + 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) + { + + } } } diff --git a/src/App/Pages/VaultListPage.cs b/src/App/Pages/VaultListPage.cs index 661dae3d1..b944569fb 100644 --- a/src/App/Pages/VaultListPage.cs +++ b/src/App/Pages/VaultListPage.cs @@ -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; } diff --git a/src/App/Pages/VaultViewSitePage.cs b/src/App/Pages/VaultViewSitePage.cs index f2fb4cbdd..a39044e6b 100644 --- a/src/App/Pages/VaultViewSitePage.cs +++ b/src/App/Pages/VaultViewSitePage.cs @@ -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() diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index c480d65c8..542410d9b 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -88,6 +88,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Back. + /// + internal static string Back { + get { + return ResourceManager.GetString("Back", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cancel. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 0610028d4..415ae9eed 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -129,6 +129,10 @@ An error has occurred. Alert title when something goes wrong. + + Back + Navigate back to the previous screen. + Cancel Cancel an operation. diff --git a/src/iOS/Resources/fa-plus.png b/src/iOS/Resources/fa-plus.png deleted file mode 100644 index 770cf597b88595d77f6f15f3287848a6f22d3855..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6mH|E?u0WbRu%|4*7N}FGB*-tA zfsvEj$ja8iHz{-CvYq=b-}`z!CdM2n8|LZa7$OnA_nal)0Re>o31PcQ8QAE%nyt=9m`e*SCJ1D-GK& kU(qnTh=p%cLBxZ6{hjqZ{Q4|U13)hKboFyt=akR{05jx9(*OVf diff --git a/src/iOS/Resources/fa-plus@2x.png b/src/iOS/Resources/fa-plus@2x.png deleted file mode 100644 index 87f33d4d205628f8245cccf579c5d4c4c076b470..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv81S@Bp6>S0GIbz&CwzF3?<=k|4ie z21Zs+0TCsA3p)pQ-?YrOiHp{6*tBQg<$LeH{%(%APykfd?djqeV$u8dvL|1I0*^!B zoWdiO2k!l!<76^zYVISq-ulRU>s&jcSzS}Lm%85$I2`Do%$jc4$$mt$)BVWJe*2EU zD#fz|ub;EHyIw1*AvFE{?x&FqnIBFaU3xHv`>OZHBS%{gT3&v2U|oRO;>pLJ-<0In xs=3tp@5jd-j&mkN%q#oosq^Wt`I=mp+pEpq9}m5u)xrr56;D?`mvv4FO#p;OW@-Qc diff --git a/src/iOS/Resources/fa-plus@3x.png b/src/iOS/Resources/fa-plus@3x.png deleted file mode 100644 index 0240071db1151b4fd0cc1d626d980da2f3e1adf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 418 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdr@&kNAT!Az_LGG))Zb17~N`m}? z85o(_1;nK^bo33a>>Qk&`Fs9FZuXmJvm_KFSNz}gb=uVf6FW7|#;NvgbT1J9c~#*G zYw=Y3t*>14Ji}8LEo)itQ!<5PWq*bi&Z&b!xqjuA3S^UUNK4)sLIpR#W93qW^zJ8!UKVnBnPHL zK}|g#F=>LDj45{AD@5cs6@?jU#--TJ-XUUcG(R?|i+iSa;~7@1X9rV7E-2N_Ipn{URCj)#!T!HlP0IO`&{eV7kDhcun zW?*DuW?^Mx=iub#;o}z&7LkyYQ&Cmd(K9hMGk0+G2~Wx`uV`-VpS5(u_FV@K9zApJ z;^nK?@7#Ox?8WQ1A3uNp{r8Se>S~~A%ROBjLo|X*FSt7~1qiqt?2il#Fj%lCL1~7t zo4|_S@~2pD&)mK?v|O{>Z_cze$ug-wx_;I*U6nsGtMl5i8Shkg{ciWPy?9Jy|Lsn* z^dGmpz9jVZ_qs%X*f%XhdS1AYZS(P`F4hIxMUtQL@+H4H9GYXhqw}rQuZ^*X76{#9 z`h&A!F@u9@=duwPc;|B5t4m$(dp QouH`nboFyt=akR{0C!V@nE(I) literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion-chevron-right@3x.png b/src/iOS/Resources/ion-chevron-right@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..8df8be9aa8e4ff7765cb0306589101afb7612d2a GIT binary patch literal 595 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4n;Ns{uYCu0VSD0lw5AL7=bPN`m}? z8JL(^SlQS)IJtOu`2_?;L?tAp1a@=v_TuH+_n*K2{u{~Wcn)adb59q?5R21mueu8zGT>po;K0;!q5Az^ z;i~s9{<$Y59^CM#duGM!?Hf{GMql1H&G1#`rqmlQvKv*hykE3*bgWQa!0fuRab@gTe~DWM4feJ`TJ literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion-plus.png b/src/iOS/Resources/ion-plus.png new file mode 100644 index 0000000000000000000000000000000000000000..fd7be4f4c5265e17f6b6356ac1c929fbad682b26 GIT binary patch literal 127 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@I3?$8F6>~X%;pFQhRzGVIc0{| QH-k*`boFyt=akR{0C(~pHUIzs literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/ion-plus@3x.png b/src/iOS/Resources/ion-plus@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..de42046a816052685eb74920679e8b3c683bb62b GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&}3?v1sWN!m0{s5m4S0IfH{P~{u0{JW@L4Lsu zi~_69O$Y&*q3`M97~;{HoZ!HAMo&TEK!bG8Dv40TRZY*dVmKI<2a1{m7)B)3ha6qe d6)5V$%&_zA8o|HarX?VwJzf1=);T3K0RRenBai?9 literal 0 HcmV?d00001 diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 00bccbcc5..91259c0f1 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -243,13 +243,22 @@ - + - + - + + + + + + + + + +