예제 #1
0
 public virtual void RemoveSplashScreen(IMvxAndroidSplashScreenActivity splashScreen)
 {
     lock (LockObject)
     {
         _currentSplashScreen = null;
     }
 }
예제 #2
0
        public virtual void InitializeFromSplashScreen(IMvxAndroidSplashScreenActivity splashScreen)
        {
            lock (LockObject)
            {
                _currentSplashScreen = splashScreen;

                if (_initializationStarted)
                {
                    if (_initialized)
                    {
                        _currentSplashScreen.InitializationComplete();
                        return;
                    }

                    return;
                }

                _initializationStarted = true;
            }

            _setup.InitializePrimary();
            ThreadPool.QueueUserWorkItem(ignored =>
            {
                _setup.InitializeSecondary();
                lock (LockObject)
                {
                    _initialized = true;
                    if (_currentSplashScreen != null)
                    {
                        _currentSplashScreen.InitializationComplete();
                    }
                }
            });
        }
예제 #3
0
 protected override void Dispose(bool isDisposing)
 {
     if (isDisposing)
     {
         lock (LockObject)
         {
             _currentSplashScreen = null;
         }
     }
     base.Dispose(isDisposing);
 }
예제 #4
0
        public virtual void InitializeFromSplashScreen(IMvxAndroidSplashScreenActivity splashScreen)
        {
            lock (LockObject)
            {
                _currentSplashScreen = splashScreen;
                if (_initialized)
                {
                    _currentSplashScreen?.InitializationComplete();
                    return;
                }

                if (IsInitialisedTaskCompletionSource != null)
                {
                    return;
                }
                else
                {
                    IsInitialisedTaskCompletionSource = new TaskCompletionSource <bool>();
                    _setup.InitializePrimary();
                    ThreadPool.QueueUserWorkItem(ignored =>
                    {
                        _setup.InitializeSecondary();
                        lock (LockObject)
                        {
                            IsInitialisedTaskCompletionSource.SetResult(true);
                            _initialized   = true;
                            var dispatcher = Mvx.GetSingleton <IMvxMainThreadDispatcher>();
                            dispatcher.RequestMainThreadAction(() =>
                            {
                                _currentSplashScreen?.InitializationComplete();
                            });
                        }
                    });
                }
            }
        }