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 000000000..b7846ead6 Binary files /dev/null and b/src/iOS/Resources/eye.png differ diff --git a/src/iOS/Resources/eye@2x.png b/src/iOS/Resources/eye@2x.png new file mode 100644 index 000000000..2f5a0e197 Binary files /dev/null and b/src/iOS/Resources/eye@2x.png differ diff --git a/src/iOS/Resources/eye@3x.png b/src/iOS/Resources/eye@3x.png new file mode 100644 index 000000000..6b33c913c Binary files /dev/null and b/src/iOS/Resources/eye@3x.png differ diff --git a/src/iOS/Resources/eye_slash.png b/src/iOS/Resources/eye_slash.png new file mode 100644 index 000000000..0e8ac8d72 Binary files /dev/null and b/src/iOS/Resources/eye_slash.png differ diff --git a/src/iOS/Resources/eye_slash@2x.png b/src/iOS/Resources/eye_slash@2x.png new file mode 100644 index 000000000..0d5ec1a82 Binary files /dev/null and b/src/iOS/Resources/eye_slash@2x.png differ diff --git a/src/iOS/Resources/eye_slash@3x.png b/src/iOS/Resources/eye_slash@3x.png new file mode 100644 index 000000000..3bbe1bd49 Binary files /dev/null and b/src/iOS/Resources/eye_slash@3x.png differ diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 2e8c57ba2..48de7259c 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -394,6 +394,24 @@ + + + + + + + + + + + + + + + + + +