1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00

Add support for hidden passwords (#920)

* Add support for hidden passwords

* Hide TOTP, hide hidden fields.

* Change _cipher to Cipher.
This commit is contained in:
Oscar Hinton
2020-06-11 22:16:43 +02:00
committed by GitHub
parent e64fb39c32
commit 52ca84946b
10 changed files with 39 additions and 13 deletions

View File

@@ -274,6 +274,8 @@ namespace Bit.App.Pages
public bool ShowAttachments => Cipher.HasAttachments;
public string ShowPasswordIcon => ShowPassword ? "" : "";
public string ShowCardCodeIcon => ShowCardCode ? "" : "";
public int PasswordFieldColSpan => Cipher.ViewPassword ? 1 : 4;
public int TotpColumnSpan => Cipher.ViewPassword ? 1 : 2;
public void Init()
{
@@ -631,7 +633,8 @@ namespace Bit.App.Pages
Fields.Add(new AddEditPageFieldViewModel(Cipher, new FieldView
{
Type = type,
Name = string.IsNullOrWhiteSpace(name) ? null : name
Name = string.IsNullOrWhiteSpace(name) ? null : name,
NewField = true,
}));
}
}
@@ -818,6 +821,7 @@ namespace Bit.App.Pages
public bool IsTextType => _field.Type == FieldType.Text;
public bool IsBooleanType => _field.Type == FieldType.Boolean;
public bool IsHiddenType => _field.Type == FieldType.Hidden;
public bool ShowViewHidden => IsHiddenType && (_cipher.ViewPassword || _field.NewField);
public void ToggleHiddenValue()
{