private void UpdateView() { _profileImage.Image?.Dispose(); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, ViewModel.MemberProfileModel.Picture)); }).ErrorPlaceholder("profile_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage); CustomUIExtensions.RoundShadow(_profileImage); UILabelExtensions.SetupLabelAppearance(_nameLabel, $"{ViewModel.MemberProfileModel.FirstName} {ViewModel.MemberProfileModel.LastName}", Colors.White, 22f); if (!string.IsNullOrEmpty(ViewModel.MemberProfileModel.Description)) { UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.MemberProfileModel.Description, Colors.White, 13f); } else { UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.MemberNoDescriptionLabel, Colors.ProfileGrayWhiter, 13f, italic: true); } _tableView.Source = new MemberSource(_tableView, ViewModel.MemberDetails); _tableView.ReloadData(); _chatButton.TouchUpInside -= OnChatButton_TouchUpInside; _chatButton.TouchUpInside += OnChatButton_TouchUpInside; _callButton.TouchUpInside -= OnCallButton_TouchUpInside; _callButton.TouchUpInside += OnCallButton_TouchUpInside; }
public void Configure(DivisionModel division) { _imageView.Image?.Dispose(); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, division.Picture)); }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_imageView); CustomUIExtensions.RoundShadow(_imageView); CustomUIExtensions.LabelShadow(_titleLabel); UILabelExtensions.SetupLabelAppearance(_titleLabel, division.Name, Colors.White, 16f, UIFontWeight.Bold); UILabelExtensions.SetupLabelAppearance(_subtitleLabel, division.Description, Colors.White, 12f); }
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); }
public void Configure(DivisionHeaderModel division) { this.BackgroundColor = Colors.MainBlue; UILabelExtensions.SetupLabelAppearance(_nameLabel, division.Name, Colors.White, 17f); UILabelExtensions.SetupLabelAppearance(_membersLabel, division.MembersCount, Colors.White, 15f); UILabelExtensions.SetupLabelAppearance(_descriptionLabel, division.Description, Colors.White, 15f); _backImage.Image = UIImage.FromBundle("back_white"); _membersImage.Image = UIImage.FromBundle("members"); _profileImage.Image?.Dispose(); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, division.Picture)); }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage); CustomUIExtensions.RoundShadow(_profileImage); }
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 void Configure(ProfileHeaderModel profile) { _profile = profile; this.BackgroundColor = Colors.MainBlue; UILabelExtensions.SetupLabelAppearance(_nameLabel, profile.Name, Colors.White, 22f); UITextFieldExtensions.SetupTextFieldAppearance(_descriptionField, Colors.White, 14f, DescriptionField, Colors.White70, Colors.White, Colors.MainBlue); _descriptionField.ReturnKeyType = UIReturnKeyType.Done; _descriptionField.AdjustsFontSizeToFitWidth = true; _descriptionField.MinimumFontSize = 11f; _descriptionField.ShouldReturn -= TextFieldShouldReturn; _descriptionField.ShouldReturn += TextFieldShouldReturn; _settingsButton.SetImage(UIImage.FromBundle("settings"), UIControlState.Normal); _settingsButton.ContentMode = UIViewContentMode.ScaleAspectFit; _settingsButton.TintColor = Colors.White; _profileImage.Image?.Dispose(); ImageService.Instance.LoadStream((token) => { return(ImageHelper.GetStreamFromImageByte(token, profile.Picture)); }).ErrorPlaceholder("add_photo", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage); CustomUIExtensions.RoundShadow(_profileImage); CustomUIExtensions.LabelShadow(_nameLabel); if (!string.IsNullOrEmpty(profile.Description)) { _descriptionField.Text = profile.Description; } else { _descriptionField.Font = UIFont.ItalicSystemFontOfSize(14f); } _descriptionField.ShouldChangeCharacters = OnDescriptionField_ShouldChangeCharacters; if (PhoneModelExtensions.IsIphoneX()) { _settingsHeightConstraint.Constant = 25; _settingsWidthConstraint.Constant = 8; } else if (!UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { _settingsHeightConstraint.Constant = 23; } _descriptionField.EditingDidBegin -= OnDescriptionField_EditingDidBegin; _descriptionField.EditingDidBegin += OnDescriptionField_EditingDidBegin; _descriptionField.EditingDidEnd -= OnDescriptionField_EditingDidEnd; _descriptionField.EditingDidEnd += OnDescriptionField_EditingDidEnd; _settingsButton.TouchUpInside -= OnConfigButton_TouchUpInside; _settingsButton.TouchUpInside += OnConfigButton_TouchUpInside; _profileButton.TouchUpInside -= OnProfileButton_TouchUpInside; _profileButton.TouchUpInside += OnProfileButton_TouchUpInside; }