Set Android InputType directly for the pin lock screen to force numeric-only keyboard layout. (#451)

* Set Android InputType directly for the pin lock screen to force numeric-only keyboard layout.

* Renamed variable
This commit is contained in:
ShirokaiLon 2019-01-24 19:45:42 +00:00 committed by Kyle Spearrin
parent 60c5bbc73d
commit 8053e6cb81
3 changed files with 9 additions and 2 deletions

View File

@ -66,6 +66,11 @@ namespace Bit.Android.Controls
Control.SetRawInputType(InputTypes.TextFlagNoSuggestions | InputTypes.TextVariationVisiblePassword); Control.SetRawInputType(InputTypes.TextFlagNoSuggestions | InputTypes.TextVariationVisiblePassword);
} }
if(_view.NumbersOnly)
{
Control.SetRawInputType(InputTypes.ClassNumber | InputTypes.NumberVariationPassword);
}
_view.ToggleIsPassword += ToggleIsPassword; _view.ToggleIsPassword += ToggleIsPassword;
if(_view.FontFamily == "monospace") if(_view.FontFamily == "monospace")

View File

@ -12,7 +12,7 @@ namespace Bit.App.Controls
{ {
PlaceholderColor = Color.FromHex("c7c7cd"); PlaceholderColor = Color.FromHex("c7c7cd");
} }
IsPasswordFromToggled = IsPassword; IsPasswordFromToggled = IsPassword;
} }
@ -57,6 +57,7 @@ namespace Bit.App.Controls
public bool DisableAutocapitalize { get; set; } public bool DisableAutocapitalize { get; set; }
public bool AllowClear { get; set; } public bool AllowClear { get; set; }
public bool HideCursor { get; set; } public bool HideCursor { get; set; }
public bool NumbersOnly { get; set; }
// Need to overwrite default handler because we cant Invoke otherwise // Need to overwrite default handler because we cant Invoke otherwise
public new event EventHandler Completed; public new event EventHandler Completed;

View File

@ -21,7 +21,8 @@ namespace Bit.App.Controls
{ {
Keyboard = Keyboard.Numeric, Keyboard = Keyboard.Numeric,
TargetMaxLength = 4, TargetMaxLength = 4,
HideCursor = true HideCursor = true,
NumbersOnly = true
}; };
Entry.BackgroundColor = Entry.TextColor = Color.Transparent; Entry.BackgroundColor = Entry.TextColor = Color.Transparent;