public override void ViewDidLoad() { base.ViewDidLoad(); this.View.Alpha = 0.3f; this.View.BackgroundColor = Colors.Black30; _sendButton.BackgroundColor = Colors.MainBlue; if (PhoneModelExtensions.IsIphoneX()) { _bottomHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } ImageService.Instance.LoadFile(_image).Transform(new RoundedTransformation(5f)).Into(_imageView); UIButtonExtensions.SetupButtonAppearance(_sendButton, Colors.White, 14f, _sendText); UIButtonExtensions.SetupButtonAppearance(_cancelButton, Colors.Black, 14f, _cancelText); _sendButton.Layer.CornerRadius = 2f; _cancelButton.Layer.CornerRadius = 2f; _sendButton.TouchUpInside -= OnSendButton_TouchUpInside; _sendButton.TouchUpInside += OnSendButton_TouchUpInside; _cancelButton.TouchUpInside -= OnCancelButton_TouchUpInside; _cancelButton.TouchUpInside += OnCancelButton_TouchUpInside; }
public override void ViewDidLoad() { base.ViewDidLoad(); if (string.IsNullOrEmpty(_image)) { Dismiss(); return; } this.View.Alpha = 0f; if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } if (Uri.IsWellFormedUriString(_image, UriKind.Absolute)) { ImageService.Instance.LoadUrl(_image).Retry(3, 200).Into(_imageView); } else { ImageService.Instance.LoadFile(_image).Retry(3, 200).Into(_imageView); } UIButtonExtensions.SetupButtonAppearance(_saveButton, Colors.Black, 15f, _saveText); _saveButton.Hidden = true; _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside; _closeButton.TouchUpInside += OnCloseButton_TouchUpInside; _saveButton.TouchUpInside -= OnSaveButton_TouchUpInside; _saveButton.TouchUpInside += OnSaveButton_TouchUpInside; }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); var titleViewMaxSize = ScreenWidth - LocalConstants.Chat_TotalIconsWidth; this.NavigationItem.TitleView = ViewModel.Chat == null ? CustomUIExtensions.SetupNavigationBarWithSubtitle(ViewModel.MemberName, ViewModel.MemberDetails, titleViewMaxSize) : CustomUIExtensions.SetupNavigationBarWithSubtitle(ViewModel.Chat.MemberName, ViewModel.Chat.MemberDetails, titleViewMaxSize); this.NavigationController.NavigationBar.TintColor = Colors.MainBlue; this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes { ForegroundColor = Colors.White }; this.NavigationItem.LeftBarButtonItem = UIButtonExtensions.SetupImageBarButton(LocalConstants.TabBarIconSize, "back_white", CloseView); this.NavigationItem.RightBarButtonItems = new UIBarButtonItem[] { UIButtonExtensions.SetupBarWithTwoButtons(LocalConstants.TabBarIconSize, "options", Options), UIButtonExtensions.SetupBarWithTwoButtons(LocalConstants.TabBarIconSize, "call_white_medium", CallUser) }; this.NavigationController.InteractivePopGestureRecognizer.Delegate = new UIGestureRecognizerDelegate(); this.NavigationController.NavigationBar.BarTintColor = Colors.MainBlue; this.NavigationController.NavigationBar.Translucent = false; this.NavigationController.SetNavigationBarHidden(false, true); this.NavigationController.NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); this.NavigationController.NavigationBar.ShadowImage = new UIImage(); UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; _navBarView.BackgroundColor = Colors.MainBlue; UpdateTableView(); }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } UIButtonExtensions.SetupButtonAppearance(_signUpButton, Colors.MainBlue, 14f, ViewModel.SignUpButton); UIButtonExtensions.SetupButtonAppearance(_signInButton, Colors.White, 16f, ViewModel.SignInButton); UIButtonExtensions.SetupButtonAppearance(_forgotPassButton, Colors.MainBlue, 12f, ViewModel.ForgotPasswordButton); _forgotPassButton.LayoutIfNeeded(); UIButton keyboardButton = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton, Colors.White, 16f, ViewModel.SignInButton); keyboardButton.TouchUpInside -= OnSignInButton_TouchUpInside; keyboardButton.TouchUpInside += OnSignInButton_TouchUpInside; _emailTextField.KeyboardType = UIKeyboardType.EmailAddress; UITextFieldExtensions.SetupField(this.View, 0, ViewModel.EmailLabel, _emailTextField, _emailLineView, _emailHeightConstraint, _emailLabel, UIReturnKeyType.Next, keyboardButton); _passwordTextField.SecureTextEntry = true; _passwordWithConstraint.Constant = (ScreenWidth - 80) - (_forgotPassButton.Frame.Width + 7); UITextFieldExtensions.SetupField(this.View, 1, ViewModel.PasswordLabel, _passwordTextField, _passwordLineView, _passwordHeightConstraint, _passwordLabel, UIReturnKeyType.Default, keyboardButton); _emailTextField.KeyboardType = UIKeyboardType.EmailAddress; _emailTextField.AutocorrectionType = UITextAutocorrectionType.No; if (!string.IsNullOrEmpty(ViewModel.UserEmail)) { _emailTextField.Text = ViewModel.UserEmail; _emailLabel.Alpha = 1; } }
public void Configure(string hint, string submit, EventHandler <string> eventHandler, EventHandler <bool> scrollToRow) { _onSubmitButton = eventHandler; _scrollToRow = scrollToRow; UITextFieldExtensions.SetupTextFieldAppearance(_textField, Colors.White, 22f, hint, Colors.White70, Colors.White, Colors.SelectBlue); UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 18f, submit); CustomUIExtensions.SelectButton(_buttonView, Colors.White); _textField.AutocorrectionType = UITextAutocorrectionType.No; _textField.TextContentType = new NSString(""); _textField.ReturnKeyType = UIReturnKeyType.Join; _submitButton.TouchUpInside -= OnSubmitButton_TouchUpInside; _submitButton.TouchUpInside += OnSubmitButton_TouchUpInside; _textField.EditingDidBegin -= OnTextField_EditingDidBegin; _textField.EditingDidBegin += OnTextField_EditingDidBegin; _textField.EditingDidEnd -= OnTextField_EditingDidEnd; _textField.EditingDidEnd += OnTextField_EditingDidEnd; _textField.ShouldReturn -= OnTextField_ShouldReturn; _textField.ShouldReturn += OnTextField_ShouldReturn; }
private void SetupView() { NavigationController.NavigationBar.TopItem.Title = string.Empty; NavigationController.NavigationBar.TintColor = Colors.White; NavigationItem.LargeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode.Never; NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(24, "podcast_share", SharePodcast); }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } _closeButton.SetImage(UIImage.FromBundle("close_white"), UIControlState.Normal); _closeButton.TintColor = Colors.White; _backgroundView.BackgroundColor = Colors.SelectBlue; _buttonBackgroundView.BackgroundColor = Colors.White; UIButton keyboardButton = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton, Colors.SelectBlue, 16f, ViewModel.AccessButton); keyboardButton.TouchUpInside -= OnSignInButton_TouchUpInside; keyboardButton.TouchUpInside += OnSignInButton_TouchUpInside; UILabelExtensions.SetupLabelAppearance(_label, ViewModel.TitleLabel, Colors.White, 24f, UIFontWeight.Thin); UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.SelectBlue, 16f, ViewModel.AccessButton); UITextFieldExtensions.SetupTextFieldAppearance(_textField, Colors.White, 26f, ViewModel.OrganizationHint, Colors.White70, Colors.White, Colors.SelectBlue, UIFontWeight.Medium); UITextFieldExtensions.AddViewToKeyboard(_textField, keyboardButton, Colors.White); _textField.AutocorrectionType = UITextAutocorrectionType.No; _textField.TextContentType = new NSString(""); UIButtonExtensions.SetupButtonUnderlineAppearance(_createOrgButton, Colors.White, 15f, ViewModel.CreateOrganization); if (!string.IsNullOrEmpty(ViewModel.EmailDomain)) { _textField.Text = ViewModel.EmailDomain.ToUpper(); } }
public void Configure(string text, EventHandler eventHandler) { _onLeaveOrganization = eventHandler; UIButtonExtensions.SetupButtonUnderlineAppearance(_leaveButton, Colors.White, 14f, text); _leaveButton.TouchUpInside -= OnLeaveButton_TouchUpInside; _leaveButton.TouchUpInside += OnLeaveButton_TouchUpInside; }
public void Configure(string buttonName, EventHandler <RegisterFormModel> buttonClick, RegisterFormModel form) { _form = form; _buttonClick = buttonClick; UIButtonExtensions.SetupButtonAppearance(_button, Colors.White, 16f, buttonName); this.BackgroundColor = Colors.MainBlue; _button.TouchUpInside -= OnButton_TouchUpInside; _button.TouchUpInside += OnButton_TouchUpInside; }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } _buttonView.BackgroundColor = Colors.MainBlue; UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 16f, ViewModel.SubmitButton); }
private void ConfigureView() { this.Title = ViewModel.Title; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { this.NavigationController.NavigationBar.PrefersLargeTitles = true; } this.NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(LocalConstants.TabBarIconSize, "new_call", OpenContacts, false); _tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; }
public void Configure(DivisionModel division, string leave, EventHandler <Tuple <NSIndexPath, DivisionModel> > leaveDivision, NSIndexPath indexPath) { _indexPath = indexPath; _division = division; _leaveDivision = leaveDivision; UILabelExtensions.SetupLabelAppearance(_label, division.Name, Colors.Black, 16f); UIButtonExtensions.SetupButtonAppearance(_button, Colors.Red, 15f, leave); _button.TouchUpInside -= OnButon_TouchUpInside; _button.TouchUpInside += OnButon_TouchUpInside; }
private void ConfigureView() { this.NavigationController.NavigationBar.PrefersLargeTitles = true; NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(24, "main_info", OpenInformationView); var search = new UISearchController(searchResultsController: null) { DimsBackgroundDuringPresentation = false, }; search.SearchBar.TintColor = UIColor.White; search.SearchBar.Placeholder = ViewModel.Search; NSString _searchField = new NSString("searchField"); var textFieldInsideSearchBar = (UITextField)search.SearchBar.ValueForKey(_searchField); var backgroundField = textFieldInsideSearchBar.Subviews[0]; backgroundField.BackgroundColor = Colors.White.ColorWithAlpha(1); backgroundField.Alpha = 1; backgroundField.Layer.CornerRadius = 10f; backgroundField.ClipsToBounds = true; _pickerHeaderView.BackgroundColor = Colors.MainBlue; _pickerHeaderView.Layer.ShadowColor = Colors.Black.CGColor; _pickerHeaderView.Layer.ShadowOffset = new CGSize(5, 5); _pickerHeaderView.Layer.ShadowRadius = 7; _pickerHeaderView.Layer.ShadowOpacity = 12; _pickerHeaderView.Layer.MasksToBounds = false; search.SearchBar.OnEditingStarted -= OnSearchBar_OnEditingStarted; search.SearchBar.OnEditingStarted += OnSearchBar_OnEditingStarted; search.SearchBar.OnEditingStopped -= OnSearchBar_OnEditingStopped; search.SearchBar.OnEditingStopped += OnSearchBar_OnEditingStopped; search.SearchBar.CancelButtonClicked -= OnSearchBar_CancelButtonClicked; search.SearchBar.CancelButtonClicked += OnSearchBar_CancelButtonClicked; search.SearchResultsUpdater = this; DefinesPresentationContext = true; NavigationItem.SearchController = search; UILabelExtensions.SetupLabelAppearance(_noResultsLabel, ViewModel.NoResultsLabel, Colors.Black, 15f, UIFontWeight.Medium); _noResultsView.Hidden = true; _tableView.Hidden = true; PickerSwitch(true); UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(() => PickerSwitch(true)); _closeTabView.AddGestureRecognizer(tapGesture); _closeTabView.Alpha = 0.4f; }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } UIButtonExtensions.SetupButtonUnderlineAppearance(_signInButton, Colors.White, 16f, ViewModel.SignIn); UIButtonExtensions.SetupButtonAppearance(_signUpButton, Colors.MainBlue, 16f, ViewModel.SignUp); _pageParent.BackgroundColor = Colors.MainBlue; _pageContainer.BackgroundColor = Colors.MainBlue; }
private void ConfigureView() { this.Title = ViewModel.Title; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { this.NavigationController.NavigationBar.PrefersLargeTitles = true; this.NavigationItem.HidesSearchBarWhenScrolling = true; } this.NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(LocalConstants.TabBarIconSize, "newchat", OpenContacts, false); _tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; _search = new UISearchController(searchResultsController: null) { DimsBackgroundDuringPresentation = false }; _search.SearchBar.TintColor = Colors.White; _search.SearchBar.BarStyle = UIBarStyle.Black; _textFieldInsideSearchBar = _search.SearchBar.ValueForKey(new NSString("searchField")) as UITextField; _textFieldInsideSearchBar.ReturnKeyType = UIReturnKeyType.Done; _textFieldInsideSearchBar.ClearButtonMode = UITextFieldViewMode.Never; _search.SearchResultsUpdater = this; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { _textFieldInsideSearchBar.Subviews[0].Alpha = 0.5f; _search.SearchBar.SetImageforSearchBarIcon(UIImage.FromBundle("search"), UISearchBarIcon.Search, UIControlState.Normal); _search.SearchBar.SetImageforSearchBarIcon(UIImage.FromBundle("clear"), UISearchBarIcon.Clear, UIControlState.Normal); this.DefinesPresentationContext = true; this.NavigationItem.SearchController = _search; } else { this.DefinesPresentationContext = false; _search.HidesNavigationBarDuringPresentation = false; _search.SearchBar.BarStyle = UIBarStyle.Default; _tableView.TableHeaderView = _search.SearchBar; } _search.SearchBar.OnEditingStarted -= OnSearchBar_OnEditingStarted; _search.SearchBar.OnEditingStarted += OnSearchBar_OnEditingStarted; _search.SearchBar.CancelButtonClicked -= OnSearchBar_CancelButtonClicked; _search.SearchBar.CancelButtonClicked += OnSearchBar_CancelButtonClicked; }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _navBarTopConstraint.Constant = LocalConstants.IphoneXNotchHeight; _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 16f, ViewModel.SubmitButton); UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.NewPassTitle, Colors.Black, 17f, UIFontWeight.Semibold); _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButton.TintColor = Colors.Black; _buttonView.BackgroundColor = Colors.MainBlue; }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = Colors.White }; this.NavigationItem.LeftBarButtonItem = UIButtonExtensions.SetupImageBarButton(LocalConstants.TabBarIconSize, "back_white", CloseView); this.NavigationController.InteractivePopGestureRecognizer.Delegate = new UIGestureRecognizerDelegate(); this.NavigationController.NavigationBar.BarTintColor = Colors.MainBlue; this.NavigationController.NavigationBar.Translucent = false; this.NavigationController.SetNavigationBarHidden(false, true); this.NavigationController.NavigationBar.ShadowImage = new UIImage(); UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; }
private void SetupView() { _backgroundView.BackgroundColor = Colors.SelectBlue; UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.TitleLabel, Colors.White, 24f); CustomUIExtensions.LabelShadow(_titleLabel); UILabelExtensions.SetupLabelAppearance(_pickerLabel, ViewModel.SelectPositionLabel, Colors.GrayIndicator, 16f, italic: true); UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 18f, ViewModel.SelectButton); _pickerImage.Image = UIImage.FromBundle("dropdown_black"); CustomUIExtensions.RoundShadow(_buttonPickerView); CustomUIExtensions.RoundShadow(_picker); CustomUIExtensions.RoundShadow(_pickerImage); CustomUIExtensions.SelectButton(_buttonView, Colors.White); }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } _view1.BackgroundColor = Colors.ProfileGrayWhiter; _view2.BackgroundColor = Colors.ProfileGrayWhiter; _view3.BackgroundColor = Colors.ProfileGrayWhiter; UITextFieldExtensions.SetupTextFieldAppearance(_currentPassword, Colors.Black, 15f, ViewModel.CurrentPass, Colors.GrayIndicator, Colors.MainBlue, Colors.White, returnKeyType: UIReturnKeyType.Next, view: this.View, tag: 0); UITextFieldExtensions.SetupTextFieldAppearance(_newPassword, Colors.Black, 15f, ViewModel.NewPassTitle, Colors.GrayIndicator, Colors.MainBlue, Colors.White, returnKeyType: UIReturnKeyType.Next, view: this.View, tag: 1); UITextFieldExtensions.SetupTextFieldAppearance(_confirmPassword, Colors.Black, 15f, ViewModel.NewPassAgainTitle, Colors.GrayIndicator, Colors.MainBlue, Colors.White, view: this.View, tag: 2); _currentPassword.SecureTextEntry = true; _newPassword.SecureTextEntry = true; _confirmPassword.SecureTextEntry = true; UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 14f, ViewModel.ChangePassword); _backgroundButton.BackgroundColor = Colors.MainBlue; var keyboardButton1 = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton1, Colors.White, 16f, ViewModel.ChangePassword); keyboardButton1.TouchUpInside -= OnSubmitButton_TouchUpInside; keyboardButton1.TouchUpInside += OnSubmitButton_TouchUpInside; var keyboardButton2 = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton2, Colors.White, 16f, ViewModel.ChangePassword); keyboardButton2.TouchUpInside -= OnSubmitButton_TouchUpInside; keyboardButton2.TouchUpInside += OnSubmitButton_TouchUpInside; var keyboardButton3 = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton3, Colors.White, 16f, ViewModel.ChangePassword); keyboardButton3.TouchUpInside -= OnSubmitButton_TouchUpInside; keyboardButton3.TouchUpInside += OnSubmitButton_TouchUpInside; _submitButton.TouchUpInside -= OnSubmitButton_TouchUpInside; _submitButton.TouchUpInside += OnSubmitButton_TouchUpInside; UITextFieldExtensions.AddViewToKeyboard(_currentPassword, keyboardButton1, Colors.MainBlue); UITextFieldExtensions.AddViewToKeyboard(_newPassword, keyboardButton2, Colors.MainBlue); UITextFieldExtensions.AddViewToKeyboard(_confirmPassword, keyboardButton3, Colors.MainBlue); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.View.Alpha = 0.3f; this.View.BackgroundColor = Colors.Black30; _backgroundView.Layer.CornerRadius = 2f; CustomUIExtensions.ViewShadow(_backgroundView); _viewButton.Layer.CornerRadius = 2f; switch (_inputType) { case QuestionType.Good: _viewButtonSmall.BackgroundColor = Colors.Green; _viewButton.BackgroundColor = Colors.Green; break; case QuestionType.Bad: _viewButtonSmall.BackgroundColor = Colors.Red; _viewButton.BackgroundColor = Colors.Red; break; case QuestionType.Normal: _viewButtonSmall.BackgroundColor = Colors.MainBlue; _viewButton.BackgroundColor = Colors.MainBlue; break; default: _viewButtonSmall.BackgroundColor = Colors.MainBlue; _viewButton.BackgroundColor = Colors.MainBlue; break; } UILabelExtensions.SetupLabelAppearance(_label, _text, Colors.Black, 20f, UIFontWeight.Medium); UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 17f, _button); _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButton.ContentMode = UIViewContentMode.ScaleAspectFit; _closeButton.TintColor = Colors.Black; _submitButton.TouchUpInside -= OnSubmitButton_TouchUpInside; _submitButton.TouchUpInside += OnSubmitButton_TouchUpInside; _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside; _closeButton.TouchUpInside += OnCloseButton_TouchUpInside; }
public override void ViewDidLoad() { base.ViewDidLoad(); _backgroundImage.Image?.Dispose(); _profileImage.Image?.Dispose(); this.View.Alpha = 0.3f; this.View.BackgroundColor = Colors.Black30; _backgroundView.Layer.CornerRadius = 2f; _buttonView.Layer.CornerRadius = 2f; _backgroundImage.Layer.CornerRadius = 2f; CustomUIExtensions.ViewShadow(_backgroundView); _buttonView.BackgroundColor = Colors.MainBlue; UIButtonExtensions.SetupButtonAppearance(_button, Colors.White, 17f, _resources[_resources.Length - 1]); _nameLabel.AttributedText = new NSAttributedString(_name, font: UIFont.BoldSystemFontOfSize(16), foregroundColor: Colors.White, shadow: CustomUIExtensions.TextShadow()); if (!string.IsNullOrEmpty(_photo)) { ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, _photo)); }).ErrorPlaceholder("letter_round_big", ImageSource.CompiledResource).Transform(new BlurredTransformation(25f)).Into(_backgroundImage); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, _photo)); }).ErrorPlaceholder("letter_round_big", ImageSource.CompiledResource).Transform(new RoundedTransformation(30)).Into(_profileImage); } else { _backgroundImage.BackgroundColor = Colors.MainBlue; _profileImage.Image = UIImage.FromBundle("letter_curved"); CustomUIExtensions.CornerView(_profileImage, 3); } _backgroundImage.ContentMode = UIViewContentMode.ScaleToFill; _button.TouchUpInside -= OnCloseButton_TouchUpInside; _button.TouchUpInside += OnCloseButton_TouchUpInside; SetupTableView(); }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += 20; } this.Title = ViewModel.Division.Name; _profileHeaderView.BackgroundColor = Colors.MainBlue; UILabelExtensions.SetupLabelAppearance(_membersLabel, $"{ViewModel.Division.UserCount} {ViewModel.MembersLabel}", Colors.White, 13f); if (!string.IsNullOrEmpty(ViewModel.Division.Description)) { UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.Division.Description, Colors.White, 13f); } else { UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.DivisionNoDescription, Colors.ProfileGrayWhiter, 13f, italic: true); } _memberImage.Image = UIImage.FromBundle("members"); _profileImage.Image?.Dispose(); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, ViewModel.Division.Picture)); }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage); CustomUIExtensions.RoundShadow(_profileImage); _buttonView1.BackgroundColor = Colors.ConnectViewButton1; _buttonView2.BackgroundColor = Colors.ConnectViewButton2; UIButtonExtensions.SetupButtonAppearance(_button1, Colors.MainBlue, 15f, ViewModel.SendEmailLabel); UIButtonExtensions.SetupButtonAppearance(_button2, Colors.MainBlue, 15f, ViewModel.CallLabel); _button1.TouchUpInside -= OnButton1_TouchUpInside; _button1.TouchUpInside += OnButton1_TouchUpInside; _button2.TouchUpInside -= OnButton2_TouchUpInside; _button2.TouchUpInside += OnButton2_TouchUpInside; _tableView.Source = new DivisionSource(_tableView, ViewModel.OrganizationInfo, ViewModel.ProfileDetails); _tableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.View.Alpha = 0.3f; this.View.BackgroundColor = Colors.Black30; _backgroundView.Layer.CornerRadius = 2f; _buttonView.Layer.CornerRadius = 2f; CustomUIExtensions.ViewShadow(_backgroundView); UILabelExtensions.SetupLabelAppearance(_titleLabel, _title, Colors.Black, 24f, UIFontWeight.Medium); UILabelExtensions.SetupLabelAppearance(_label1, _text1, Colors.GrayLabel, 14f); UILabelExtensions.SetupLabelAppearance(_label2, _text2, Colors.GrayLabel, 14f); UILabelExtensions.SetupLabelAppearance(_label3, _text3, Colors.GrayLabel, 14f); CustomUIExtensions.RoundView(_dotview1); CustomUIExtensions.RoundView(_dotview2); CustomUIExtensions.RoundView(_dotview3); if (string.IsNullOrEmpty(_text2)) { _dotview2.Hidden = true; _label2.Hidden = true; } if (string.IsNullOrEmpty(_text3)) { _dotview3.Hidden = true; _label3.Hidden = true; } UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 17f, _confirmButtonText); _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButton.ContentMode = UIViewContentMode.ScaleAspectFit; _closeButton.TintColor = Colors.Black; _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside; _closeButton.TouchUpInside += OnCloseButton_TouchUpInside; _submitButton.TouchUpInside -= OnSubmitButton_TouchUpInside; _submitButton.TouchUpInside += OnSubmitButton_TouchUpInside; }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _navigationTopConstraint.Constant = LocalConstants.IphoneXNotchHeight; _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom; } UIButtonExtensions.SetupButtonAppearance(_button, Colors.White, 16f, ViewModel.SubmitButton); UIButtonExtensions.SetupButtonAppearance(_requestCodeButton, Colors.MainBlue, 15f, ViewModel.ResendCodeButton); UILabelExtensions.SetupLabelAppearance(_activateLabel, ViewModel.ActivateLabel, Colors.GrayDivider, 14f); UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.Title, Colors.Black, 17f, UIFontWeight.Semibold); var keyboardButton = new UIButton(); UIButtonExtensions.SetupButtonAppearance(keyboardButton, Colors.White, 16f, ViewModel.SubmitButton); keyboardButton.TouchUpInside -= OnSubmitButton_TouchUpInside; keyboardButton.TouchUpInside += OnSubmitButton_TouchUpInside; UITextFieldExtensions.AddViewToKeyboard(_textField, keyboardButton, Colors.MainBlue); _textField.AutocorrectionType = UITextAutocorrectionType.No; _textField.TextContentType = new NSString(""); _closeButon.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButon.TintColor = Colors.Black; _backgroundView.BackgroundColor = Colors.MainBlue4; _buttonView.BackgroundColor = Colors.MainBlue; _textField.TextColor = Colors.MainBlue; _textField.AttributedPlaceholder = new NSAttributedString(ViewModel.PlaceHolder, new UIStringAttributes() { ForegroundColor = Colors.GrayIndicator }); _textField.BecomeFirstResponder(); _requestCodeButton.TouchUpInside -= OnRequestCodeButton_TouchUpInside; _requestCodeButton.TouchUpInside += OnRequestCodeButton_TouchUpInside; _button.TouchUpInside -= OnSubmitButton_TouchUpInside; _button.TouchUpInside += OnSubmitButton_TouchUpInside; _closeButon.TouchUpInside -= OnCloseButon_TouchUpInside; _closeButon.TouchUpInside += OnCloseButon_TouchUpInside; }
private void SetupView() { if (PhoneModelExtensions.IsIphoneX()) { _buttonHeightConstraint.Constant += 20; } _backHeightConstraint.Constant = _backHeightConstraint.Constant + (PhoneModelExtensions.IsIphoneX() ? 20 : 0); _tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; _headerView.BackgroundColor = Colors.MainBlue; _backImage.Image = UIImage.FromBundle("back_white"); _chatView.BackgroundColor = Colors.ConnectViewButton1; _callView.BackgroundColor = Colors.ConnectViewButton2; UIButtonExtensions.SetupButtonAppearance(_chatButton, Colors.MainBlue, 15f, ViewModel.ChatLabel); UIButtonExtensions.SetupButtonAppearance(_callButton, Colors.MainBlue, 15f, ViewModel.CallLabel); _backButton.TouchUpInside -= OnBackButton_TouchUpInside; _backButton.TouchUpInside += OnBackButton_TouchUpInside; }
private void SetupView(bool canContinue) { _descriptionLabel.Hidden = false; if (canContinue) { UIButtonExtensions.SetupButtonAppearance(_continueButton, Colors.Black, 18f, ViewModel.SubmitButton, UIFontWeight.Light); CustomUIExtensions.SelectButton(_continueView, Colors.Black); _continueButton.TouchUpInside -= OnContinueButton_TouchUpInside; _continueButton.TouchUpInside += OnContinueButton_TouchUpInside; ShouldContinue(true); } else { UIButtonExtensions.SetupButtonUnderlineAppearance(_leaveDivisionButton, Colors.Black, 14f, ViewModel.LeaveButton, UIFontWeight.Light); UIButtonExtensions.SetupButtonUnderlineAppearance(_logoutButton, Colors.Black, 14f, ViewModel.LogoutButton, UIFontWeight.Light); UILabelExtensions.SetupLabelAppearance(_helpLabel, ViewModel.HelpLabel, Colors.Black, 14f, UIFontWeight.Light); UIButtonExtensions.SetupButtonUnderlineAppearance(_helpButton, Colors.SelectBlue, 14f, ViewModel.Division.Email); ShouldContinue(false); _reloadButton.TouchUpInside -= OnReloadButton_TouchUpInside; _reloadButton.TouchUpInside += OnReloadButton_TouchUpInside; _leaveDivisionButton.TouchUpInside -= OnLeaveDivisionButton_TouchUpInside; _leaveDivisionButton.TouchUpInside += OnLeaveDivisionButton_TouchUpInside; _logoutButton.TouchUpInside -= OnLogoutButton_TouchUpInside; _logoutButton.TouchUpInside += OnLogoutButton_TouchUpInside; _helpButton.TouchUpInside -= OnHelpButton_TouchUpInside; _helpButton.TouchUpInside += OnHelpButton_TouchUpInside; } }
public override void ViewDidLoad() { base.ViewDidLoad(); this.View.Alpha = 0.3f; this.View.BackgroundColor = Colors.Black30; _backGroundView.Layer.CornerRadius = 2f; _buttonColorBig.Layer.CornerRadius = 2f; CustomUIExtensions.ViewShadow(_backGroundView); UILabelExtensions.SetupLabelAppearance(_titleLabel, _title, Colors.Black, 24f, UIFontWeight.Medium); UILabelExtensions.SetupLabelAppearance(_filterByNameLabel, _filters[0].Title, Colors.Black, 14f); UILabelExtensions.SetupLabelAppearance(_filterByNameDescription, _filters[0].Description, Colors.GrayLabel, 12f); UILabelExtensions.SetupLabelAppearance(_switchLabel, _filters[1].Title, Colors.Black, 14f); UILabelExtensions.SetupLabelAppearance(_descriptionLabel, _filters[1].Description, Colors.GrayLabel, 12f); _buttonColorBig.BackgroundColor = Colors.MainBlue; _buttonColorSmall.BackgroundColor = Colors.MainBlue; UIButtonExtensions.SetupButtonAppearance(_button, Colors.White, 17f, _buttonText); _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButton.ContentMode = UIViewContentMode.ScaleAspectFit; _closeButton.TintColor = Colors.Black; _filterByNameSwitch.On = _filters[0].IsActive; _switch.On = _filters[1].IsActive; _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside; _closeButton.TouchUpInside += OnCloseButton_TouchUpInside; _button.TouchUpInside -= OnSubmitButton_TouchUpInside; _button.TouchUpInside += OnSubmitButton_TouchUpInside; }
public void Configure(FormModel formModel, NSIndexPath indexPath, EventHandler <NSIndexPath> scrollToFieldEvent, UIView view) { _formModel = formModel; _scrollToFieldEvent = scrollToFieldEvent; _indexPath = indexPath; _keyboardButton = null; _textField.SecureTextEntry = false; if (_formModel.SubmitKeyboardButtonAction != null) { _keyboardButton = new UIButton(); UIButtonExtensions.SetupButtonAppearance(_keyboardButton, Colors.White, 16f, _formModel.KeyboardButtonText); _keyboardButton.TouchUpInside -= OnKeyboardButton_TouchUpInside; _keyboardButton.TouchUpInside += OnKeyboardButton_TouchUpInside; } switch (_formModel.FieldType) { case FieldType.Email: _textField.KeyboardType = UIKeyboardType.EmailAddress; break; case FieldType.Phone: _textField.KeyboardType = UIKeyboardType.PhonePad; _textField.EditingChanged -= OnTextField_EditingChanged; _textField.EditingChanged += OnTextField_EditingChanged; break; case FieldType.Code: _textField.KeyboardType = UIKeyboardType.Default; _textField.AutocapitalizationType = UITextAutocapitalizationType.AllCharacters; break; case FieldType.Password: _textField.KeyboardType = UIKeyboardType.Default; _textField.SecureTextEntry = true; break; default: break; } if (_formModel.ButtonText != null) { string buttonText = _formModel.ButtonText[0]; if (!_textField.SecureTextEntry && _formModel.FieldType == FieldType.Password) { buttonText = _formModel.ButtonText[1]; } UIButtonExtensions.SetupButtonAppearance(_button, Colors.MainBlue, 12f, buttonText); TextFieldSize(true); _button.TouchUpInside -= OnTextFieldButton_TouchUpInside; _button.TouchUpInside += OnTextFieldButton_TouchUpInside; } else { TextFieldSize(false); } _textField.EditingDidBegin -= OnTextField_EditingDidBegin; _textField.EditingDidBegin += OnTextField_EditingDidBegin; _textField.EditingDidEnd -= OnTextField_EditingDidEnd; _textField.EditingDidEnd += OnTextField_EditingDidEnd; UITextFieldExtensions.SetupField(view, _formModel.Position, _formModel.IndicatorText, _textField, _indicatorView, _textFieldHeightConstraint, _indicatorLabel, _formModel.ReturnKeyType == ReturnKeyType.Default ? UIReturnKeyType.Default : UIReturnKeyType.Next, _keyboardButton); _textField.AutocorrectionType = UITextAutocorrectionType.No; _textField.TextContentType = new NSString(""); if (!string.IsNullOrEmpty(_formModel.TextFieldValue)) { _textField.Text = _formModel.TextFieldValue; _indicatorLabel.TextColor = Colors.GrayIndicator; _indicatorLabel.Alpha = 1; } }
public override void ViewDidLoad() { base.ViewDidLoad(); DismissKeyboardOnBackgroundTap(); this.View.Alpha = 0.3f; if (_questionType == QuestionType.Bad) { _buttonView1.BackgroundColor = Colors.Red; _buttonView2.BackgroundColor = Colors.Red; UILabelExtensions.SetupLabelAppearance(_subtitleLabel, _subtitle, Colors.Red, 30, UIFontWeight.Bold); } else { _buttonView1.BackgroundColor = Colors.MainBlue; _buttonView2.BackgroundColor = Colors.MainBlue; UILabelExtensions.SetupLabelAppearance(_subtitleLabel, _subtitle, Colors.SomeBlue, 30, UIFontWeight.Bold); } switch (_inputType) { case InputType.Email: _textField.KeyboardType = UIKeyboardType.EmailAddress; break; case InputType.Number: _textField.KeyboardType = UIKeyboardType.NumberPad; break; case InputType.Phone: _textField.KeyboardType = UIKeyboardType.PhonePad; break; case InputType.Password: _textField.SecureTextEntry = true; break; default: _textField.KeyboardType = UIKeyboardType.Default; break; } _textField.AutocorrectionType = UITextAutocorrectionType.No; if (string.IsNullOrEmpty(_subtitle)) { _subtitleLabel.Text = string.Empty; _subtitleLabel.Hidden = true; _subtitleLabel.Frame = new CGRect(); _subtitleHeightConstraint.Constant = 0; } this.View.BackgroundColor = Colors.Black30; _backgroundView.Layer.CornerRadius = 2f; _buttonView.Layer.CornerRadius = 2f; CustomUIExtensions.ViewShadow(_backgroundView); UILabelExtensions.SetupLabelAppearance(_titleLabel, _title, Colors.Black, 18); UITextFieldExtensions.SetupField(this.View, 0, _hint, _textField, _indicatorView, _textFieldHeightConstraint, _indicatorLabel); UIButtonExtensions.SetupButtonAppearance(_confirmButton, Colors.White, 17f, _confirmButtonText); if (!string.IsNullOrEmpty(_inputContent)) { _textField.Text = _inputContent; _indicatorLabel.Alpha = 1; } _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal); _closeButton.ContentMode = UIViewContentMode.ScaleAspectFit; _closeButton.TintColor = Colors.Black; _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside; _closeButton.TouchUpInside += OnCloseButton_TouchUpInside; _confirmButton.TouchUpInside -= OnConfirmButton_TouchUpInside; _confirmButton.TouchUpInside += OnConfirmButton_TouchUpInside; }
public override void ViewDidLoad() { base.ViewDidLoad(); _viewSize = (float)UIScreen.MainScreen.Bounds.Width; _barView = new UIView(); _barView.BackgroundColor = Colors.MainBlue; _separatorView.BackgroundColor = Colors.GrayDividerContacts; _separatorView.Hidden = true; if (ViewModel.IsPresentingCustomView == ContactListViewModel.ContactsType.All) { this.Title = ViewModel.Title; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { this.NavigationController.NavigationBar.PrefersLargeTitles = false; this.NavigationItem.LargeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode.Never; } this.NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(LocalConstants.TabBarIconSize, "contacts_filter", OpenFilter, false); _presentView.Hidden = true; _presentViewHeightConstraint.Constant = 0; } else { UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.IsPresentingCustomView == ContactListViewModel.ContactsType.Call ? ViewModel.NewCallTitle : ViewModel.NewChatTitle, Colors.Black, 17f, UIFontWeight.Semibold); UIButtonExtensions.SetupButtonAppearance(_cancelButton, _cancelButton.TintColor, 17f, ViewModel.Cancel); _cancelButton.TitleLabel.Lines = 1; _cancelButton.TitleLabel.AdjustsFontSizeToFitWidth = true; _cancelButton.TitleLabel.LineBreakMode = UILineBreakMode.Clip; _cancelButton.TouchUpInside -= OnCancelButton_TouchUpInside; _cancelButton.TouchUpInside += OnCancelButton_TouchUpInside; if (PhoneModelExtensions.IsIphoneX()) { _titleLabelHeightConstraint.Constant = _titleLabelHeightConstraint.Constant + 10; } } _pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal); this.AddChildViewController(_pageViewController); _pageView.AddSubview(_pageViewController.View); _tableViewGesture.AddTarget(() => HandleDrag(_tableViewGesture)); this.View.AddSubview(_barView); this.View.BringSubviewToFront(_barView); ConfigureView(); _search = new UISearchController(searchResultsController: null) { DimsBackgroundDuringPresentation = false }; _search.SearchBar.TintColor = Colors.White; _search.SearchBar.BarStyle = UIBarStyle.Black; _textFieldInsideSearchBar = _search.SearchBar.ValueForKey(new NSString("searchField")) as UITextField; _textFieldInsideSearchBar.ReturnKeyType = UIReturnKeyType.Done; _textFieldInsideSearchBar.ClearButtonMode = UITextFieldViewMode.Never; _search.SearchBar.OnEditingStarted -= OnSearchBar_OnEditingStarted; _search.SearchBar.OnEditingStarted += OnSearchBar_OnEditingStarted; _search.SearchBar.OnEditingStopped -= OnSearchBar_OnEditingStopped; _search.SearchBar.OnEditingStopped += OnSearchBar_OnEditingStopped; _search.SearchBar.CancelButtonClicked -= OnSearchBar_CancelButtonClicked; _search.SearchBar.CancelButtonClicked += OnSearchBar_CancelButtonClicked; _search.SearchResultsUpdater = this; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { _textFieldInsideSearchBar.Text = ViewModel.SearchLabel; _textFieldInsideSearchBar.Subviews[0].Alpha = 0.07f; _search.SearchBar.SetImageforSearchBarIcon(UIImage.FromBundle("search"), UISearchBarIcon.Search, UIControlState.Normal); _search.SearchBar.SetImageforSearchBarIcon(UIImage.FromBundle("clear"), UISearchBarIcon.Clear, UIControlState.Normal); this.DefinesPresentationContext = true; this.NavigationItem.SearchController = _search; } else { this.DefinesPresentationContext = false; _search.HidesNavigationBarDuringPresentation = false; _search.SearchBar.BarStyle = UIBarStyle.Default; if (_tableViews?.Count > 0) { _tableViews.FirstOrDefault().TableHeaderView = _search.SearchBar; } } ViewModel.PropertyChanged -= ViewModel_PropertyChanged; ViewModel.PropertyChanged += ViewModel_PropertyChanged; }