mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-22 11:35:21 +01:00
move splash screen logic to OnResignActivation (#1674)
This commit is contained in:
parent
05bcc10277
commit
dddc38ef64
@ -183,17 +183,8 @@ namespace Bit.iOS
|
|||||||
return base.FinishedLaunching(app, options);
|
return base.FinishedLaunching(app, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DidEnterBackground(UIApplication uiApplication)
|
public override void OnResignActivation(UIApplication uiApplication)
|
||||||
{
|
{
|
||||||
_storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
|
|
||||||
_messagingService.Send("slept");
|
|
||||||
|
|
||||||
if (UIApplication.SharedApplication.KeyWindow == null)
|
|
||||||
{
|
|
||||||
// Despite IDE warning, KeyWindow is null here during app termination in iOS 15
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
||||||
{
|
{
|
||||||
Tag = 4321
|
Tag = 4321
|
||||||
@ -213,6 +204,13 @@ namespace Bit.iOS
|
|||||||
UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
|
UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
|
||||||
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
|
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
|
||||||
UIApplication.SharedApplication.SetStatusBarHidden(true, false);
|
UIApplication.SharedApplication.SetStatusBarHidden(true, false);
|
||||||
|
base.OnResignActivation(uiApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DidEnterBackground(UIApplication uiApplication)
|
||||||
|
{
|
||||||
|
_storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
|
||||||
|
_messagingService.Send("slept");
|
||||||
base.DidEnterBackground(uiApplication);
|
base.DidEnterBackground(uiApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user