mirror of
https://github.com/bitwarden/android.git
synced 2025-03-07 23:16:00 +03:00
Added toggle apssword button to add site page as well
This commit is contained in:
parent
db6ceea711
commit
9718e5aace
3 changed files with 18 additions and 8 deletions
|
@ -70,6 +70,7 @@ namespace Bit.App.Controls
|
|||
if(ToggleIsPassword == null)
|
||||
{
|
||||
IsPassword = IsPasswordFromToggled = !IsPassword;
|
||||
Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -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) =>
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue