Example #1
0
        private static UITextField CreateTextField(TextField field, float Y)
        {
            UITextField textField = new LoginTextField(new RectangleF(0, Y, DefaultWidth, DefaultHeight))
            {
                AutocapitalizationType = UITextAutocapitalizationType.None,
                AutocorrectionType     = UITextAutocorrectionType.No,
                BackgroundColor        = UIColor.White,
                Placeholder            = field.Label,
                Text            = field.Text,
                TextAlignment   = UITextAlignment.Left,
                SecureTextEntry = field.IsPassword,
                KeyboardType    = UIKeyboardType.Default
            };

            if (field is EmailField)
            {
                textField.KeyboardType = UIKeyboardType.EmailAddress;
            }
            else if (field is NumericField)
            {
                textField.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
            }

            textField.Layer.CornerRadius = 5f;
            textField.Layer.BorderColor  = new UIColor(0.784f, 0.78f, 0.8f, 1).CGColor;
            textField.Layer.BorderWidth  = 1f;

            return(textField);
        }
Example #2
0
        void ReleaseDesignerOutlets()
        {
            if (EmailTextField != null)
            {
                EmailTextField.Dispose();
                EmailTextField = null;
            }

            if (FullNameTextField != null)
            {
                FullNameTextField.Dispose();
                FullNameTextField = null;
            }

            if (LoginTextField != null)
            {
                LoginTextField.Dispose();
                LoginTextField = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (SignUpButton != null)
            {
                SignUpButton.Dispose();
                SignUpButton = null;
            }
        }
Example #3
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(BackgroundImage.FullSizeOf(this));

            this.AddConstraints(
                InvalidCredentialsLabel.WithSameLeft(LoginTextField),
                InvalidCredentialsLabel.WithSameRight(LoginTextField),
                InvalidCredentialsLabel.Height().EqualTo(AppDimens.DefaultErrorMessageHeight),
                InvalidCredentialsLabel.Above(LoginTextField, AppDimens.Inset3X));

            this.AddConstraints(
                LoginTextField.AtLeftOf(this, AppDimens.Inset5X),
                LoginTextField.AtRightOf(this, AppDimens.Inset5X),
                LoginTextField.Height().EqualTo(AppDimens.DefaultTextFieldHeight),
                LoginTextField.Above(PasswordTextField, AppDimens.Inset2X));

            this.AddConstraints(
                PasswordTextField.WithSameLeft(LoginTextField),
                PasswordTextField.WithSameCenterY(this),
                PasswordTextField.WithSameRight(LoginTextField),
                PasswordTextField.Height().EqualTo(AppDimens.DefaultTextFieldHeight));

            this.AddConstraints(
                LoginButton.AtLeftOf(this, AppDimens.Inset8X),
                LoginButton.AtRightOf(this, AppDimens.Inset8X),
                LoginButton.Below(PasswordTextField, AppDimens.Inset2X),
                LoginButton.Height().EqualTo(AppDimens.DefaultButtonHeight));
        }
 void ReleaseDesignerOutlets()
 {
     if (ErrorImageView != null)
     {
         ErrorImageView.Dispose();
         ErrorImageView = null;
     }
     if (ErrorLabel != null)
     {
         ErrorLabel.Dispose();
         ErrorLabel = null;
     }
     if (IVendLabel != null)
     {
         IVendLabel.Dispose();
         IVendLabel = null;
     }
     if (LoginButton != null)
     {
         LoginButton.Dispose();
         LoginButton = null;
     }
     if (LoginTextField != null)
     {
         LoginTextField.Dispose();
         LoginTextField = null;
     }
     if (MenuButton != null)
     {
         MenuButton.Dispose();
         MenuButton = null;
     }
     if (PasswordTextField != null)
     {
         PasswordTextField.Dispose();
         PasswordTextField = null;
     }
     if (TitleLabel != null)
     {
         TitleLabel.Dispose();
         TitleLabel = null;
     }
     if (VersionLabel != null)
     {
         VersionLabel.Dispose();
         VersionLabel = null;
     }
 }
Example #5
0
 /// <summary>
 /// Try to log in by user name and password.
 /// Throws Invalid operation exception if login or password are not right
 /// </summary>
 /// <param name="userName">string with user name</param>
 /// <param name="userPassword">string with user password</param>
 /// <returns>Next page, if log in is correct</returns>
 public WorkspacePage LogIn(string userName, string userPassword)
 {
     LoginTextField.SendKeys(userName);
     PasswordTextField.SendKeys(userPassword);
     while (LoginTextField.GetAttribute("value") != userName)
     {
         LoginTextField.Clear();
         LoginTextField.SendKeys(userName);
     }
     SubmitButton.Click();
     Driver.SwitchTo().Window(Driver.WindowHandles.Last());
     if (Driver.Title == title)
     {
         throw new InvalidOperationException();
     }
     return(new WorkspacePage(Driver));
 }
Example #6
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                BackgroundView.FullSizeOf(this));

            this.AddConstraints(
                InvalidCredentialLabel.AtLeftOf(this, AppDimens.Inset6X),
                InvalidCredentialLabel.AtRightOf(this, AppDimens.Inset6X),
                InvalidCredentialLabel.Height().EqualTo(AppDimens.Inset8X),
                InvalidCredentialLabel.Above(LoginTextField, AppDimens.Inset4X));

            this.AddConstraints(
                LoginTextField.AtLeftOf(this, AppDimens.Inset6X),
                LoginTextField.AtRightOf(this, AppDimens.Inset6X),
                LoginTextField.Height().EqualTo(AppDimens.Inset6X),
                LoginTextField.Above(PasswordTextField, AppDimens.Inset2X));

            this.AddConstraints(
                PasswordTextField.WithSameLeft(LoginTextField),
                PasswordTextField.WithSameRight(LoginTextField),
                PasswordTextField.Height().EqualTo(AppDimens.Inset6X),
                PasswordTextField.WithSameCenterY(this));

            this.AddConstraints(
                LoginButton.WithSameLeft(LoginTextField),
                LoginButton.Below(PasswordTextField, AppDimens.Inset2X),
                LoginButton.WithSameRight(LoginTextField),
                LoginButton.Height().EqualTo(AppDimens.Inset6X));

            this.AddConstraints(
                ActivityIndicatorView.WithSameCenterX(this),
                ActivityIndicatorView.WithSameCenterY(this));
        }
 public static string BindFirstResponder(this LoginTextField self)
 => LoginTextFieldFirstResponderTargetBinding.BindingName;
Example #8
0
 public void FillLoginTextField(string content)
 {
     LoginTextField.SendKeys(content);
 }