1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-03 08:39:46 +01:00

reveal hidden value for custom fields

This commit is contained in:
Kyle Spearrin 2017-09-26 11:06:50 -04:00
parent 590fe211c4
commit 3ea81ce2fb

View File

@ -174,7 +174,7 @@ namespace Bit.App.Pages
case FieldType.Hidden: case FieldType.Hidden:
var hidden = field.Type == FieldType.Hidden; var hidden = field.Type == FieldType.Hidden;
var textFieldCell = new FormEntryCell(label, isPassword: hidden); var textFieldCell = new FormEntryCell(label, isPassword: hidden, useButton: hidden);
textFieldCell.Entry.Text = value; textFieldCell.Entry.Text = value;
textFieldCell.Entry.DisableAutocapitalize = true; textFieldCell.Entry.DisableAutocapitalize = true;
textFieldCell.Entry.Autocorrect = false; textFieldCell.Entry.Autocorrect = false;
@ -183,6 +183,18 @@ namespace Bit.App.Pages
{ {
textFieldCell.Entry.FontFamily = Helpers.OnPlatform( textFieldCell.Entry.FontFamily = Helpers.OnPlatform(
iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier"); iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier");
textFieldCell.Button.Image = "eye";
textFieldCell.Button.Command = new Command(() =>
{
textFieldCell.Entry.InvokeToggleIsPassword();
textFieldCell.Button.Image =
"eye" + (!textFieldCell.Entry.IsPasswordFromToggled ? "_slash" : string.Empty);
});
}
if(Device.RuntimePlatform == Device.Android && textFieldCell.Button != null)
{
textFieldCell.Button.WidthRequest = 40;
} }
textFieldCell.InitEvents(); textFieldCell.InitEvents();