diff --git a/src/Android/Controls/ExtendedEntryRenderer.cs b/src/Android/Controls/ExtendedEntryRenderer.cs index 10dab3ab1..f1c02291c 100644 --- a/src/Android/Controls/ExtendedEntryRenderer.cs +++ b/src/Android/Controls/ExtendedEntryRenderer.cs @@ -66,6 +66,11 @@ namespace Bit.Android.Controls Control.SetRawInputType(InputTypes.TextFlagNoSuggestions | InputTypes.TextVariationVisiblePassword); } + if(_view.NumbersOnly) + { + Control.SetRawInputType(InputTypes.ClassNumber | InputTypes.NumberVariationPassword); + } + _view.ToggleIsPassword += ToggleIsPassword; if(_view.FontFamily == "monospace") diff --git a/src/App/Controls/ExtendedEntry.cs b/src/App/Controls/ExtendedEntry.cs index c41426976..bcb67bd63 100644 --- a/src/App/Controls/ExtendedEntry.cs +++ b/src/App/Controls/ExtendedEntry.cs @@ -12,7 +12,7 @@ namespace Bit.App.Controls { PlaceholderColor = Color.FromHex("c7c7cd"); } - + IsPasswordFromToggled = IsPassword; } @@ -57,6 +57,7 @@ namespace Bit.App.Controls public bool DisableAutocapitalize { get; set; } public bool AllowClear { get; set; } public bool HideCursor { get; set; } + public bool NumbersOnly { get; set; } // Need to overwrite default handler because we cant Invoke otherwise public new event EventHandler Completed; diff --git a/src/App/Controls/PinControl.cs b/src/App/Controls/PinControl.cs index 0903fdc0d..59714cc24 100644 --- a/src/App/Controls/PinControl.cs +++ b/src/App/Controls/PinControl.cs @@ -21,7 +21,8 @@ namespace Bit.App.Controls { Keyboard = Keyboard.Numeric, TargetMaxLength = 4, - HideCursor = true + HideCursor = true, + NumbersOnly = true }; Entry.BackgroundColor = Entry.TextColor = Color.Transparent;