예제 #1
0
        /// <summary>
        /// If the user have credential store in local
        /// Launch the auto connection
        /// </summary>
        private async void AutoConnexion()
        {
            LoaderImage.Visibility              = ViewStates.Visible;
            Email.Visibility                    = ViewStates.Gone;
            Password.Visibility                 = ViewStates.Gone;
            GoToWhatIsSeekiosLayout.Visibility  = ViewStates.Gone;
            Connect.Visibility                  = ViewStates.Gone;
            GoToCreateAccountLayout.Visibility  = ViewStates.Gone;
            GoToForgetPasswordLayout.Visibility = ViewStates.Gone;

            if (!await App.Locator.Login.AutoConnect(DeviceInfoHelper.DeviceModel
                                                     , DeviceInfoHelper.Platform
                                                     , DeviceInfoHelper.Version
                                                     , DeviceInfoHelper.GetDeviceUniqueId(this)
                                                     , DeviceInfoHelper.CountryCode))
            {
                LoaderImage.Visibility              = ViewStates.Gone;
                Email.Visibility                    = ViewStates.Visible;
                Password.Visibility                 = ViewStates.Visible;
                GoToWhatIsSeekiosLayout.Visibility  = ViewStates.Visible;
                Connect.Visibility                  = ViewStates.Visible;
                GoToCreateAccountLayout.Visibility  = ViewStates.Visible;
                GoToForgetPasswordLayout.Visibility = ViewStates.Visible;
            }
        }
예제 #2
0
        /// <summary>
        /// Connect the user
        /// </summary>
        private async void ConnectClick(object sender, EventArgs e)
        {
            // Send to DataService info of entered email and password
            App.Locator.Login.Email    = Email.Text;
            App.Locator.Login.Password = Password.Text;

            if (!Email.Text.IsEmail())
            {
                Email.Error = Resources.GetString(Resource.String.createAccount_errorEmail);
                return;
            }

            // Hide Keyboard
            using (var imm = (Android.Views.InputMethods.InputMethodManager)GetSystemService(InputMethodService))
            {
                imm.HideSoftInputFromWindow(Connect.WindowToken, 0);
            }

            LoadingLayout.Visibility = ViewStates.Visible;

            await App.Locator.Login.Connect(DeviceInfoHelper.DeviceModel
                                            , DeviceInfoHelper.Platform
                                            , DeviceInfoHelper.Version
                                            , DeviceInfoHelper.GetDeviceUniqueId(this)
                                            , DeviceInfoHelper.CountryCode);

            LoadingLayout.Visibility = ViewStates.Invisible;
        }
 private void OnConnectivityChanged(object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e)
 {
     if (AppInformationLayout != null)
     {
         AppInformationLayout.Visibility = e.IsConnected ? ViewStates.Gone : ViewStates.Visible;
         OnConnectionStateChanged?.Invoke(e.IsConnected);
     }
     if (e.IsConnected)
     {
         App.Locator.ListSeekios.SubscribeToSignalR();
         App.Locator.ListSeekios.LoadUserEnvironment(DeviceInfoHelper.DeviceModel
                                                     , DeviceInfoHelper.Platform
                                                     , DeviceInfoHelper.Version
                                                     , DeviceInfoHelper.GetDeviceUniqueId(this)
                                                     , DeviceInfoHelper.CountryCode);
     }
 }
예제 #4
0
        private void ShowCGUPopup()
        {
            if (_popupCGU == null)
            {
                var refreshInProgressBuilder = new Android.Support.V7.App.AlertDialog.Builder(this, Resource.Style.Theme_AppCompat_Light_Dialog);
                var inflater = (LayoutInflater)GetSystemService(LayoutInflaterService);
                var view     = inflater.Inflate(Resource.Drawable.CGUPopup, null);

                //get the different elements
                //_stepInformationTextView = view.FindViewById<TextView>(Resource.Id.popupRefreshInProgress_stepText);
                //_titleTextView = view.FindViewById<TextView>(Resource.Id.popupRefreshinProgress_title);
                _linkToCGUTextView = view.FindViewById <TextView>(Resource.Id.popupcgu_linkwebcgu);

                _linkToCGUTextView.Click += OnGoToCGUURLButtonClick;

                //Android.Text.ISpanned cgu = Android.Text.Html.FromHtml("");
                //_stepInformationTextView.TextFormatted = cgu;
                //_stepInformationTextView.MovementMethod = new Android.Text.Method.ScrollingMovementMethod();

                //_stepInformationTextView.Text = Resources.GetString(Resource.String.map_TextStep3);

                //Cancel button
                refreshInProgressBuilder.SetNegativeButton(Resource.String.popupcgu_buttonDontAgree, (senderAlert, args) =>
                {
                    if (_popupCGU != null)
                    {
                        _popupCGU.Dismiss();
                    }
                });
                refreshInProgressBuilder.SetPositiveButton(Resource.String.popupcgu_buttonAgree, (senderAlert, args) =>
                {
                    App.Locator.Login.CreateAccount(FirstNameEditText.Text
                                                    , LastNameEditText.Text
                                                    , DeviceInfoHelper.DeviceModel
                                                    , DeviceInfoHelper.Platform
                                                    , DeviceInfoHelper.Version
                                                    , DeviceInfoHelper.GetDeviceUniqueId(this)
                                                    , DeviceInfoHelper.CountryCode).ContinueWith(c => { _popupCGU?.Dismiss(); });
                });
                refreshInProgressBuilder.SetView(view);
                _popupCGU = refreshInProgressBuilder.Create();
                _popupCGU.DismissEvent += _popupRefresh_DismissEvent;
            }
            _popupCGU.Show();
        }