handle timers more appropriately

This commit is contained in:
Kyle Spearrin 2017-12-05 13:58:09 -05:00
parent 5bae15831b
commit f092d4ffc3
3 changed files with 23 additions and 22 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="AutoFillServiceSummary"> <string name="AutoFillServiceSummary">
Assist in filling username and password fields in other apps and on the web. Assist with filling username and password fields in other apps and on the web.
</string> </string>
<string name="AutoFillServiceDescription"> <string name="AutoFillServiceDescription">
It can be difficult for users (especially those with disabilities) to switch between apps and copy/paste It can be difficult for users (especially those with disabilities) to switch between apps and copy/paste

View file

@ -169,10 +169,17 @@ namespace Bit.App.Pages
}; };
ScrollView = new ScrollView { Content = DisabledStackLayout }; ScrollView = new ScrollView { Content = DisabledStackLayout };
Title = AppResources.AutofillAccessibilityService;
Content = ScrollView;
}
protected override void OnAppearing()
{
_pageDisappeared = false;
UpdateEnabled(); UpdateEnabled();
Device.StartTimer(new TimeSpan(0, 0, 3), () => Device.StartTimer(new TimeSpan(0, 0, 3), () =>
{ {
System.Diagnostics.Debug.WriteLine("Check timer on accessibility");
if(_pageDisappeared) if(_pageDisappeared)
{ {
return false; return false;
@ -182,13 +189,6 @@ namespace Bit.App.Pages
return true; return true;
}); });
Title = AppResources.AutofillAccessibilityService;
Content = ScrollView;
}
protected override void OnAppearing()
{
_pageDisappeared = false;
base.OnAppearing(); base.OnAppearing();
} }
@ -200,7 +200,8 @@ namespace Bit.App.Pages
private void UpdateEnabled() private void UpdateEnabled()
{ {
ScrollView.Content = _appInfoService.AutofillAccessibilityServiceEnabled ? EnabledStackLayout : DisabledStackLayout; ScrollView.Content = _appInfoService.AutofillAccessibilityServiceEnabled ?
EnabledStackLayout : DisabledStackLayout;
} }
private Label BuildServiceLabel() private Label BuildServiceLabel()

View file

@ -120,10 +120,17 @@ namespace Bit.App.Pages
}; };
ScrollView = new ScrollView { Content = DisabledStackLayout }; ScrollView = new ScrollView { Content = DisabledStackLayout };
Title = AppResources.AutofillService;
Content = ScrollView;
}
protected override void OnAppearing()
{
_pageDisappeared = false;
UpdateEnabled(); UpdateEnabled();
Device.StartTimer(new TimeSpan(0, 0, 2), () => Device.StartTimer(new TimeSpan(0, 0, 2), () =>
{ {
System.Diagnostics.Debug.WriteLine("Check timer on autofill");
if(_pageDisappeared) if(_pageDisappeared)
{ {
return false; return false;
@ -133,13 +140,6 @@ namespace Bit.App.Pages
return true; return true;
}); });
Title = AppResources.AutofillService;
Content = ScrollView;
}
protected override void OnAppearing()
{
_pageDisappeared = false;
base.OnAppearing(); base.OnAppearing();
} }