make sure PIN doesnt show on screen. adjust focus.

This commit is contained in:
Kyle Spearrin 2017-12-11 14:29:50 -05:00
parent 0c4c8534b4
commit 25b75fd6e4
5 changed files with 19 additions and 3 deletions

View file

@ -66,6 +66,11 @@ namespace Bit.Android.Controls
{
Control.Typeface = Typeface.Monospace;
}
if(_view.HideCursor)
{
Control.SetCursorVisible(false);
}
}
private void ToggleIsPassword(object sender, EventArgs e)

View file

@ -56,6 +56,7 @@ namespace Bit.App.Controls
public bool? Autocorrect { get; set; }
public bool DisableAutocapitalize { get; set; }
public bool AllowClear { get; set; }
public bool HideCursor { get; set; }
// Need to overwrite default handler because we cant Invoke otherwise
public new event EventHandler Completed;

View file

@ -21,13 +21,19 @@ namespace Bit.App.Controls
{
Keyboard = Keyboard.Numeric,
MaxLength = 4,
Margin = new Thickness(0, int.MaxValue, 0, 0)
HideCursor = true
};
Entry.BackgroundColor = Entry.TextColor = Color.Transparent;
if(Device.RuntimePlatform == Device.Android)
{
Label.TextColor = Color.Black;
}
else
{
Entry.Margin = new Thickness(0, int.MaxValue, 0, 0);
}
}
public Label Label { get; set; }

View file

@ -87,6 +87,7 @@ namespace Bit.App.Pages
{
for(int i = 0; i < 5; i++)
{
await Task.Delay(1000);
if(!PinControl.Entry.IsFocused)
{
Device.BeginInvokeOnMainThread(() => PinControl.Entry.Focus());
@ -95,8 +96,6 @@ namespace Bit.App.Pages
{
break;
}
await Task.Delay(1000);
}
});
}

View file

@ -41,6 +41,11 @@ namespace Bit.iOS.Controls
Control.AutocorrectionType = view.Autocorrect.Value ? UITextAutocorrectionType.Yes : UITextAutocorrectionType.No;
}
if(view.HideCursor)
{
Control.TintColor = UIColor.Clear;
}
if(view.ReturnType.HasValue)
{
switch(view.ReturnType.Value)