async private void CheckWSO2ServerStatus()
        {
            var appTokenModel = await RestAPI.GetApplicationToken();

            if (appTokenModel != null)
            {
                TextViewServerStatus.Text      = "Online";
                TextViewServerStatus.TextColor = new UIColor(red: 0.14f, green: 0.62f, blue: 0.07f, alpha: 1.0f);
            }
            else
            {
                TextViewServerStatus.Text      = "Offline";
                TextViewServerStatus.TextColor = new UIColor(red: 0.62f, green: 0.07f, blue: 0.07f, alpha: 1.0f);
            }
        }
Beispiel #2
0
        async private void CheckWSO2ServerStatus()
        {
            EditText editTextDeveloperMenuStatusWSO2 = FindViewById <EditText>(Resource.Id.editTextDeveloperMenuStatusWSO2);

            var appTokenModel = await RestAPI.GetApplicationToken();

            if (appTokenModel != null)
            {
                editTextDeveloperMenuStatusWSO2.Text = "Online";
                editTextDeveloperMenuStatusWSO2.SetTextColor(Android.Graphics.Color.DarkGreen);
            }
            else
            {
                editTextDeveloperMenuStatusWSO2.Text = "Offline";
                editTextDeveloperMenuStatusWSO2.SetTextColor(Android.Graphics.Color.DarkRed);
            }
        }
        async protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.RegisterViewParadiset);

            progress = new ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetMessage(Lang.LOADING);
            progress.SetCancelable(false);

            btnRegister        = FindViewById <Button>(Resource.Id.btnRegisterViewRegister);
            btnRegister.Click += btnRegister_Click;
            btnRegister.SetBackgroundColor(Android.Graphics.Color.ParseColor(GeneralSettings.ButtonBackgroundColor));
            btnRegister.SetTextColor(Android.Graphics.Color.ParseColor(GeneralSettings.ButtonTextColor));

            //buttonRegisterViewTermAndCondition = FindViewById<Button>(Resource.Id.buttonRegisterViewTermAndCondition);
            //buttonRegisterViewTermAndCondition.Click += buttonRegisterViewTermAndCondition_Click;

            //buttonRegisterViewPrivacyPolicy = FindViewById<Button>(Resource.Id.buttonRegisterViewPrivacyPolicy);
            //buttonRegisterViewPrivacyPolicy.Click += buttonRegisterViewPrivacyPolicy_Click;



            // EditText txtEditMobileNo = FindViewById<EditText>(Resource.Id.txtRegisterViewMobileNo);
            // txtEditMobileNo.AddTextChangedListener(this);

            //HÄR SKA VI SÄTTA TELEFON LANDSNUMMER
            FindViewById <EditText>(Resource.Id.txtRegisterViewMobileNoCountry).Text = GeneralSettings.TelephoneNoMasking;
            setCurrentClientTheme();
            //Hämtar ner ApplicationToken
            appTokenModel = await RestAPI.GetApplicationToken();

            // FindViewById<EditText>(Resource.Id.txtRegisterViewMobileNo).Hint = GeneralSettings.TelephoneNoMasking;
        }
        async public override void ViewDidLoad()
        {
            setCurrentClientTheme();
            var tap = new UITapGestureRecognizer();

            tap.AddTarget(() => View.EndEditing(true));
            View.AddGestureRecognizer(tap);
            tap.CancelsTouchesInView = false;

            this.txtEmail.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };

            this.txtCountryCode.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };

            this.txtMobileNo.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };

            this.txtPersNr.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };

            this.txtPwd1.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };

            this.txtPwd2.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                return(true);
            };


            //SET MAX CHAR
            this.txtCountryCode.ShouldChangeCharacters = (UITextField textField, NSRange range, string replacementString) =>
            {
                // Calculate new length
                var length = textField.Text.Length - range.Length + replacementString.Length;
                return(length <= 3);
            };


            appTokenModel = await RestAPI.GetApplicationToken();

            if (appTokenModel == null)
            {
                //Skickar användaren till inloggningssidan
                var mainController = Storyboard.InstantiateViewController("loginNavigationController");
                UIApplication.SharedApplication.KeyWindow.RootViewController = mainController;

                UIAlertView _msg = new UIAlertView(Lang.ERROR_HEADLINE, Lang.UNEXPECTED_ERROR, null, Lang.BUTTON_OK, null);
                _msg.Show();
            }

            txtEmail.ShouldChangeCharacters = (textField, range, replacementString) =>
            {
                var newLength = textField.Text.Length + replacementString.Length - range.Length;
                return(newLength <= 50);
            };

            txtMobileNo.ShouldChangeCharacters = (textField, range, replacementString) =>
            {
                var newLength = textField.Text.Length + replacementString.Length - range.Length;
                return(newLength <= 20);
            };

            //txtFirstName.ShouldChangeCharacters = (textField, range, replacementString) =>
            //{
            //    var newLength = textField.Text.Length + replacementString.Length - range.Length;
            //    return newLength <= 20;
            //};

            //txtLastName.ShouldChangeCharacters = (textField, range, replacementString) =>
            //{
            //    var newLength = textField.Text.Length + replacementString.Length - range.Length;
            //    return newLength <= 20;
            //};

            //txtPassword1.ShouldChangeCharacters = (textField, range, replacementString) =>
            //{
            //    var newLength = textField.Text.Length + replacementString.Length - range.Length;
            //    return newLength <= 20;
            //};

            //txtPassword2.ShouldChangeCharacters = (textField, range, replacementString) =>
            //{
            //    var newLength = textField.Text.Length + replacementString.Length - range.Length;
            //    return newLength <= 20;
            //};



            txtCountryCode.Text = GeneralSettings.TelephoneNoMasking;
            //txtMobileNo.Placeholder = GeneralSettings.TelephoneNoMasking;
        }