public RegistrationFormView() { emailField = CreateField(); emailField.KeyboardType = UIKeyboardType.EmailAddress; emailField.AutocapitalizationType = UITextAutocapitalizationType.None; userNameField = CreateField(); userNameField.AutocapitalizationType = UITextAutocapitalizationType.None; passwordField = CreateField(); passwordField.SecureTextEntry = true; passwordConfirmationField = CreateField(); passwordConfirmationField.SecureTextEntry = true; ApplyFieldsNavigation(() => OnRegisterClick(EventArgs.Empty), emailField, userNameField, passwordField, passwordConfirmationField); registerButton = CreateButton(); registerButton.SetBackgroundImage(UIImage.FromFile("Images/register-button.png").StretchableImage(5, 0), UIControlState.Normal); registerButton.TouchUpInside += (sender, e) => OnRegisterClick(EventArgs.Empty); AddSubviews(emailField, userNameField, passwordField, passwordConfirmationField, registerButton); Bounds = new RectangleF(0, 0, 299, 281); }
public ResetPasswordFormView() { emailField = CreateField(); emailField.KeyboardType = UIKeyboardType.EmailAddress; emailField.AutocapitalizationType = UITextAutocapitalizationType.None; ApplyFieldsNavigation(() => OnResetClick(EventArgs.Empty), emailField); resetButton = CreateButton(); resetButton.SetBackgroundImage(UIImage.FromFile("Images/reset-button.png").StretchableImage(5, 0), UIControlState.Normal); resetButton.TouchUpInside += (sender, e) => OnResetClick(EventArgs.Empty); AddSubviews(emailField, resetButton); Bounds = new RectangleF(0, 0, 299, 162); }
public LoginFormView(bool showForgotPassword, bool showRegister) { this.showForgotPassword = showForgotPassword; this.showRegister = showRegister; userNameField = CreateField(); userNameField.AutocapitalizationType = UITextAutocapitalizationType.None; userNameField.TextInset = new UIEdgeInsets(6, 10, 6, 30); passwordField = CreateField(); passwordField.SecureTextEntry = true; passwordField.TextInset = new UIEdgeInsets(6, 10, 6, 30); ApplyFieldsNavigation(() => OnLogInClick(EventArgs.Empty), userNameField, passwordField); userNameIconView = new UIImageView(UIImage.FromFile("Images/username-icon.png")); passwordIconView = new UIImageView(UIImage.FromFile("Images/password-icon.png")); loginButton = CreateButton(); loginButton.SetBackgroundImage(UIImage.FromFile("Images/login-button.png").StretchableImage(5, 0), UIControlState.Normal); loginButton.TouchUpInside += (sender, e) => OnLogInClick(EventArgs.Empty); forgotPasswordButton = new UIButton { ExclusiveTouch = true, Font = Fonts.HelveticaNeueMedium(13), TitleShadowOffset = new SizeF(0f, 1f) }; forgotPasswordButton.SetTitleColor(UIColor.FromRGB(65, 100, 140), UIControlState.Normal); forgotPasswordButton.SetTitleShadowColor(UIColor.White.ColorWithAlpha(0.7f), UIControlState.Normal); forgotPasswordButton.TouchUpInside += (sender, e) => OnForgotPasswordClick(EventArgs.Empty); arrowView = new UIImageView(UIImage.FromFile("Images/arrow-right.png")); orLabel = CreateLabel(); registerSuggesionLabel = CreateLabel(); var divider = UIImage.FromFile("Images/divider-line.png"); leftDividerView = new UIImageView(divider); rightDividerView = new UIImageView(divider); registerButton = CreateButton(); registerButton.SetBackgroundImage(UIImage.FromFile("Images/register-button.png").StretchableImage(5, 0), UIControlState.Normal); registerButton.TouchUpInside += (sender, e) => OnRegisterClick(EventArgs.Empty); List <UIView> subViews = new List <UIView> (new UIView [] { userNameField, passwordField, userNameIconView, passwordIconView, loginButton }); if (this.showForgotPassword) { subViews.AddRange(new UIView [] { forgotPasswordButton, arrowView }); } if (this.showRegister) { subViews.AddRange(new UIView [] { leftDividerView, rightDividerView, orLabel, registerSuggesionLabel, registerButton }); } AddSubviews(subViews.ToArray()); BackButtonHidden = true; int boundsHeight = 331; if (!this.showForgotPassword) { boundsHeight -= 33; } if (!this.showRegister) { boundsHeight -= 101; } Bounds = new CGRect(0, 0, 299, boundsHeight); }