diff --git a/src/App/Controls/ExtendedEntry.cs b/src/App/Controls/ExtendedEntry.cs index 201bb9152..97cb1844c 100644 --- a/src/App/Controls/ExtendedEntry.cs +++ b/src/App/Controls/ExtendedEntry.cs @@ -70,6 +70,7 @@ namespace Bit.App.Controls if(ToggleIsPassword == null) { IsPassword = IsPasswordFromToggled = !IsPassword; + Focus(); } else { diff --git a/src/App/Pages/Vault/VaultAddSitePage.cs b/src/App/Pages/Vault/VaultAddSitePage.cs index 64505004b..c4fcfab2e 100644 --- a/src/App/Pages/Vault/VaultAddSitePage.cs +++ b/src/App/Pages/Vault/VaultAddSitePage.cs @@ -41,7 +41,11 @@ namespace Bit.App.Pages private void Init() { var notesCell = new FormEditorCell(height: 90); - PasswordCell = new FormEntryCell(AppResources.Password, IsPassword: true, nextElement: notesCell.Editor); + PasswordCell = new FormEntryCell(AppResources.Password, IsPassword: true, nextElement: notesCell.Editor, + useButton: true); + PasswordCell.Button.Image = "eye"; + PasswordCell.Button.Clicked += PasswordButton_Clicked; + var usernameCell = new FormEntryCell(AppResources.Username, nextElement: PasswordCell.Entry); usernameCell.Entry.DisableAutocapitalize = true; usernameCell.Entry.Autocorrect = false; @@ -180,6 +184,12 @@ namespace Bit.App.Pages } } + private void PasswordButton_Clicked(object sender, EventArgs e) + { + PasswordCell.Entry.InvokeToggleIsPassword(); + PasswordCell.Button.Image = "eye" + (!PasswordCell.Entry.IsPasswordFromToggled ? "_slash" : string.Empty); + } + private async void GenerateCell_Tapped(object sender, EventArgs e) { var page = new ToolsPasswordGeneratorPage((password) => diff --git a/src/App/Pages/Vault/VaultEditSitePage.cs b/src/App/Pages/Vault/VaultEditSitePage.cs index 0e1dd75f6..52fe570e7 100644 --- a/src/App/Pages/Vault/VaultEditSitePage.cs +++ b/src/App/Pages/Vault/VaultEditSitePage.cs @@ -57,7 +57,6 @@ namespace Bit.App.Pages usernameCell.Entry.DisableAutocapitalize = true; usernameCell.Entry.Autocorrect = false; - usernameCell.Entry.FontFamily = PasswordCell.Entry.FontFamily = Device.OnPlatform(iOS: "Courier", Android: "monospace", WinPhone: "Courier"); @@ -198,12 +197,6 @@ namespace Bit.App.Pages } } - private void PasswordButton_Clicked(object sender, EventArgs e) - { - PasswordCell.Entry.InvokeToggleIsPassword(); - PasswordCell.Button.Image = "eye" + (!PasswordCell.Entry.IsPasswordFromToggled ? "_slash" : string.Empty); - } - protected override void OnAppearing() { base.OnAppearing(); @@ -213,6 +206,12 @@ namespace Bit.App.Pages } } + private void PasswordButton_Clicked(object sender, EventArgs e) + { + PasswordCell.Entry.InvokeToggleIsPassword(); + PasswordCell.Button.Image = "eye" + (!PasswordCell.Entry.IsPasswordFromToggled ? "_slash" : string.Empty); + } + private async void GenerateCell_Tapped(object sender, EventArgs e) { if(!string.IsNullOrWhiteSpace(PasswordCell.Entry.Text)