Exemplo n.º 1
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            // this is the earliest we can show the modal login
            // show unconditionally on launch
            if (_hasShownCredentials)
            {
                if (View.Bounds != _prevBounds)
                {
                    SetupDrawer();
                    var user = DrawXSettingsManager.LoggedInUser;
                    if (user != null)
                    {
                        _drawer.LoginToServerAsync(user);
                        _hasShownCredentials = true;  // skip credentials if saved user in store
                    }
                    View?.SetNeedsDisplay();
                }
            }
            else
            {
                EditCredentials();
                _hasShownCredentials = true;
            }
        }
Exemplo n.º 2
0
        protected override void OnStart()
        {
            base.OnStart();
            if (_drawer == null)
            {
                if (DrawXSettingsManager.HasCredentials())
                {
                    // assume we can login and be able to draw
                    // TODO handle initial failure to login despite saved credentials
                    SetupDrawer();
                }
            }

            if (DrawXSettingsManager.LoggedInUser != null)
            {
                _drawer.LoginToServerAsync(DrawXSettingsManager.LoggedInUser);
                _hasShownCredentials = true;  // skip credentials if saved user in store
            }
            if (!_hasShownCredentials)
            {
                EditCredentials();
                _hasShownCredentials = true;
            }
        }