public override void DidEnterBackground(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)
            {
                Tag = 4321
            };
            var backgroundView = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
            {
                BackgroundColor = ThemeManager.GetResourceColor("SplashBackgroundColor").ToUIColor()
            };
            var logo      = new UIImage(!ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png");
            var imageView = new UIImageView(logo)
            {
                Center = new CoreGraphics.CGPoint(view.Center.X, view.Center.Y - 30)
            };

            view.AddSubview(backgroundView);
            view.AddSubview(imageView);
            UIApplication.SharedApplication.KeyWindow.AddSubview(view);
            UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
            UIApplication.SharedApplication.KeyWindow.EndEditing(true);
            UIApplication.SharedApplication.SetStatusBarHidden(true, false);
            base.DidEnterBackground(uiApplication);
        }
Beispiel #2
0
        protected async override void OnSleep()
        {
            System.Diagnostics.Debug.WriteLine("XF App: OnSleep");
            _isResumed = false;
            if (Device.RuntimePlatform == Device.Android)
            {
                var isLocked = await _vaultTimeoutService.IsLockedAsync();

                if (!isLocked)
                {
                    await _storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
                }
                SetTabsPageFromAutofill(isLocked);
                await SleptAsync();
            }
        }
Beispiel #3
0
 public override void DidEnterBackground(UIApplication uiApplication)
 {
     _stateService?.SetLastActiveTimeAsync(_deviceActionService.GetActiveTime());
     _messagingService?.Send("slept");
     base.DidEnterBackground(uiApplication);
 }
Beispiel #4
0
 private void SaveActivity()
 {
     SetServices();
     _storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
 }
 public long GetActiveTime()
 {
     return(_deviceActionService.GetActiveTime());
 }
Beispiel #6
0
 private async Task SaveActivityAsync()
 {
     SetServices();
     await _stateService.SetLastActiveTimeAsync(_deviceActionService.GetActiveTime());
 }
Beispiel #7
0
 public override void DidEnterBackground(UIApplication uiApplication)
 {
     _storageService?.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
     _messagingService?.Send("slept");
     base.DidEnterBackground(uiApplication);
 }