From 79892cbf9ffa7a585c541010ac17a3e1c1c8dff8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 17 Jun 2016 00:37:51 -0400 Subject: [PATCH] Added eye button icon for show/hide password --- src/App/Models/Page/VaultViewSitePageModel.cs | 3 +++ src/App/Pages/VaultViewSitePage.cs | 5 +++-- src/iOS/Resources/eye.png | Bin 0 -> 557 bytes src/iOS/Resources/eye@2x.png | Bin 0 -> 872 bytes src/iOS/Resources/eye@3x.png | Bin 0 -> 1258 bytes src/iOS/Resources/eye_slash.png | Bin 0 -> 580 bytes src/iOS/Resources/eye_slash@2x.png | Bin 0 -> 1005 bytes src/iOS/Resources/eye_slash@3x.png | Bin 0 -> 1378 bytes src/iOS/iOS.csproj | 18 ++++++++++++++++++ 9 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/iOS/Resources/eye.png create mode 100644 src/iOS/Resources/eye@2x.png create mode 100644 src/iOS/Resources/eye@3x.png create mode 100644 src/iOS/Resources/eye_slash.png create mode 100644 src/iOS/Resources/eye_slash@2x.png create mode 100644 src/iOS/Resources/eye_slash@3x.png diff --git a/src/App/Models/Page/VaultViewSitePageModel.cs b/src/App/Models/Page/VaultViewSitePageModel.cs index 93a8097fb..d391260b4 100644 --- a/src/App/Models/Page/VaultViewSitePageModel.cs +++ b/src/App/Models/Page/VaultViewSitePageModel.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using Bit.App.Resources; +using Xamarin.Forms; namespace Bit.App.Models.Page { @@ -103,10 +104,12 @@ namespace Bit.App.Models.Page PropertyChanged(this, new PropertyChangedEventArgs(nameof(RevealPassword))); PropertyChanged(this, new PropertyChangedEventArgs(nameof(MaskedPassword))); PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowHideText))); + PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowHideImage))); } } public string MaskedPassword => RevealPassword ? Password : Password == null ? null : new string('●', Password.Length); public string ShowHideText => RevealPassword ? AppResources.Hide : AppResources.Show; + public ImageSource ShowHideImage => RevealPassword ? ImageSource.FromFile("eye_slash") : ImageSource.FromFile("eye"); public void Update(Site site) { diff --git a/src/App/Pages/VaultViewSitePage.cs b/src/App/Pages/VaultViewSitePage.cs index 923cf05be..962edda1e 100644 --- a/src/App/Pages/VaultViewSitePage.cs +++ b/src/App/Pages/VaultViewSitePage.cs @@ -52,9 +52,10 @@ namespace Bit.App.Pages UsernameCell.Button1.Command = new Command(() => Copy(Model.Username, AppResources.Username)); // Password - PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: AppResources.Show, button2Text: AppResources.Copy); + PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: string.Empty, button2Text: AppResources.Copy); PasswordCell.Value.SetBinding(Label.TextProperty, s => s.MaskedPassword); - PasswordCell.Button1.SetBinding(Button.TextProperty, s => s.ShowHideText); + PasswordCell.Button1.SetBinding(Button.ImageProperty, s => s.ShowHideImage); + PasswordCell.Button1.Margin = new Thickness(10, 0); PasswordCell.Button1.Command = new Command(() => Model.RevealPassword = !Model.RevealPassword); PasswordCell.Button2.Command = new Command(() => Copy(Model.Password, AppResources.Password)); diff --git a/src/iOS/Resources/eye.png b/src/iOS/Resources/eye.png new file mode 100644 index 0000000000000000000000000000000000000000..b7846ead69fb2e675929de386ea6257a7ad3e637 GIT binary patch literal 557 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+3?vf;>QaH!s{o%6S0HWEyJsYz-6>T(K;Qb7 z1o;IsFfuW-vaxe;a&hzU^6?7_iHM3z$jHj6sA*{F7?@euI=Z-edHV-O#>S--my}jF zb#(V_+P-VwfrH1-oI8K@=B+yq9zA>U`t8Th-+%r+%IlR3G3Q*Cc9Z_MpHv1eno%C(-XHGjoDpUm-<&w1)xAnbW)iOkgx`x?|ebsH|) z-ui8N2y}j?Q d

|k3?#4J%UH$0z-SlX6XFWw+Vt)jMdXEm)9v|- zfFYP!666=mz{teR!pg?Z!O6|T%f~MuBqAy%E+Hu`BPXw@tfgmQWMXP&Zee9(>*(U@ z=I-h36Q7ilk(rZUQd(Zw(K&I-)af&pu3o!-!4=f8##iBaZhR=Ps^qpB<@ZUb{as?%WQm$zOj6b53=i_HR;d z@fzWRHFK|S=#<*Hw`c9=IV*fM5*1r!@yq9&-06SjKhwh|wm9brd-?9?+|4RTdgaN_ z^(wmc7_06<+q=)MOwuz;2;FEiC3mG;#>$f`b5H)`sFXDRaC4f-g-Om$`X}$Tuuqcy zpsc$1^!t^|RsKvWe5c;HTIpe^>#Cj`K~JPaN>5lHE$XRQdZU^zv_-mWiDaSc#MuE; zt|!;~OcZjyCMtP*`ExJ+h4Uso+~S#GX%rNn=yr@N$I9r~ZJsU1QZ1r4EV?1}CU(-p zDKDbSQ)2${WxuLscK_V9r1)yy_F3NApZ;*%%X;9-al72)Ngi*-%9fK>8;swtJYOBg zUZ!SxWY+5hnJHY|-L01x-O|rp(#S4rZt0EmPXDy*^VGWvH`YE`Zu@uo7k1&#ixOr> SODO^)oWax8&t;ucLK6VH(wXxB literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/eye@3x.png b/src/iOS/Resources/eye@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6b33c913c643b630bc3ad5c57a10d1c350df8126 GIT binary patch literal 1258 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL3?z5Yp7oxAfpKSmPlzj!Yty@D6b-o$Ses}4 z8yI<$N`m}?85o(ESy!#U!MpWn|^#6%>_}Rn;`Kv~_g#4Nc9= zEv;YG~IIy!s$Cr+9& zb;hjOa~CaMx_14BO(0FgkDfex@$&WC_a8rh z{r>a!-!plO)fpI={5)M8LnI{M9!zzf9LUi2@cAC*mW3yl9cFpsa#U<%;6~xu0dEfQ z8O&VZH=}rW{l@3I2|1hXieqOP9Zl}}=ey?TmuAH^6Vt=X&h@{@H!16x^#0tgjynBK z#WR%Z=B*9OJh#qdY0SDHPF~MrHFgp9#^2^}7OmAfW_f%@PWQyCF7x)i)C#cfSk13J zb;9YFs$c3Pv~RER6ieUm>(TRun7K<_W1V|`2j1;l9b36ADb;+HOm=^Y)yeJ7rt3HE z>OGcwOlp>{DWj(QtE5TOCtdEny4vvcM!7JLT?}(3iUlhuW$K5uGnGa@n5g_(bVJaq zg$HyZ*GA-in!?L?Ub(22{ne60E|U{i+pa2vtAAJ*GfyyKp$wPlsbV1sy~$goPFy?n zo#{n<{bZ-Y$}`Ceyp7@;bh*9+c}=akXfh#yXUDn#ZdDc0DAqTjx*q}-N_kl<3*g=m zEycp8@ulU_Bd#Mw4lz+(rv8nrB3D;7eCFGsu$tK;RQrOj;L8;?&&)oYocOecg>CuC z=X;g}EM^Md@a%-}Z^k_{)#9JBt7V5h5V@wu`l{HWsI4Zo{N&`kDd)c=%)Kza7X&zJ2e} z$(&Hmw9Da6_v7yG{cJK*wPcsm(wV%>B8F8vg6bz^_)k(VE^WPdzhj-vh0kxi)n>oi kUs_XpC*#zV{~x*M>VEt%#pC{2V7h1UboFyt=akR{0G8fWD*ylh literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/eye_slash.png b/src/iOS/Resources/eye_slash.png new file mode 100644 index 0000000000000000000000000000000000000000..0e8ac8d72cab566b75fe2e6a73a4a23e06c71622 GIT binary patch literal 580 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+3?vf;>QaH!w*a3IS0HWEyJw`KMSm_m0{T3# zB*-tAfsu)sg_Vtilbe@cP)I~VN=8*nM_1p#)Xc)k*~Qh($3G|}G$Jx4J)@wwq_U== zyJyn$d5e~=Ub|t-*6oLnpEz~(`mH({cA qb^Pu9Ze(hE?G5hSG`;L6dv?@Uv6gFdo?HgHo59o7&t;ucLK6T&3kl)? literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/eye_slash@2x.png b/src/iOS/Resources/eye_slash@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0d5ec1a82b76ec4e44b7ab4376acd924ea9ccbe4 GIT binary patch literal 1005 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UH$0z*rvO6XFWw+Vt)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