From 15e154feb0c5c7be9da9815113ec5603090430fd Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 6 Jun 2016 21:13:00 -0400 Subject: [PATCH] pin lock page modifications --- src/App/App.cs | 6 ++++++ src/App/Controls/PinControl.cs | 4 ++-- src/App/Pages/LockFingerprintPage.cs | 5 +++++ src/App/Pages/LockPinPage.cs | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/App/App.cs b/src/App/App.cs index 8a3d9883c..86e232256 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -76,6 +76,12 @@ namespace Bit.App { CheckLockAsync(false); } + + var lockPage = Current.MainPage.Navigation.ModalStack.LastOrDefault() as LockPinPage; + if(lockPage != null) + { + lockPage.PinControl.Entry.Focus(); + } } private async Task CheckLockAsync(bool forceLock) diff --git a/src/App/Controls/PinControl.cs b/src/App/Controls/PinControl.cs index 8b9a11907..68060bae5 100644 --- a/src/App/Controls/PinControl.cs +++ b/src/App/Controls/PinControl.cs @@ -24,8 +24,8 @@ namespace Bit.App.Controls Entry = new ExtendedEntry { Keyboard = Keyboard.Numeric, - IsVisible = false, - MaxLength = 4 + MaxLength = 4, + Margin = new Thickness(0, int.MaxValue, 0, 0) }; Entry.SetBinding(Xamarin.Forms.Entry.TextProperty, s => s.PIN); Entry.TextChanged += PinEntry_TextChanged; diff --git a/src/App/Pages/LockFingerprintPage.cs b/src/App/Pages/LockFingerprintPage.cs index 68fdaf6e5..8d61547b9 100644 --- a/src/App/Pages/LockFingerprintPage.cs +++ b/src/App/Pages/LockFingerprintPage.cs @@ -55,6 +55,11 @@ namespace Bit.App.Pages Content = stackLayout; } + protected override bool OnBackButtonPressed() + { + return false; + } + protected override void OnAppearing() { base.OnAppearing(); diff --git a/src/App/Pages/LockPinPage.cs b/src/App/Pages/LockPinPage.cs index b8960d0fa..706887716 100644 --- a/src/App/Pages/LockPinPage.cs +++ b/src/App/Pages/LockPinPage.cs @@ -46,7 +46,7 @@ namespace Bit.App.Pages { Padding = new Thickness(30, 40), Spacing = 10, - Children = { PinControl.Label, PinControl.Entry, logoutButton } + Children = { PinControl.Label, logoutButton, PinControl.Entry } }; Title = "Verify PIN"; @@ -54,6 +54,12 @@ namespace Bit.App.Pages BindingContext = Model; } + + protected override bool OnBackButtonPressed() + { + return false; + } + protected override void OnAppearing() { base.OnAppearing();