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

retry focus until it works on pin lock page

This commit is contained in:
Kyle Spearrin 2017-08-29 15:25:16 -04:00
parent 9ae39f3900
commit 66996f491c

View File

@ -5,6 +5,7 @@ using Xamarin.Forms;
using XLabs.Ioc;
using Bit.App.Models.Page;
using Bit.App.Controls;
using System.Threading.Tasks;
namespace Bit.App.Pages
{
@ -79,7 +80,29 @@ namespace Bit.App.Pages
_tgr.Tapped += Tgr_Tapped;
PinControl.OnPinEntered += PinEntered;
PinControl.InitEvents();
PinControl.Entry.FocusWithDelay();
if(Device.RuntimePlatform == Device.Android)
{
Task.Run(async () =>
{
for(int i = 0; i < 5; i++)
{
await Task.Delay(1000);
if(!PinControl.Entry.IsFocused)
{
Device.BeginInvokeOnMainThread(() => PinControl.Entry.Focus());
}
else
{
break;
}
}
});
}
else
{
PinControl.Entry.Focus();
}
}
protected override void OnDisappearing()