Ejemplo n.º 1
0
 private void SetupView()
 {
     _closeButton.SetImage(UIImage.FromBundle("close_white"), UIControlState.Normal);
     _closeButton.TintColor          = Colors.White;
     _backgroundView.BackgroundColor = Colors.SelectBlue;
     UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.NewUser ? ViewModel.TitleMainLabel : ViewModel.TitleLabel, Colors.White, 24f);
     CustomUIExtensions.LabelShadow(_titleLabel);
 }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _imageView.Image = UIImage.FromBundle(_image);
            _titleLabel.Text = _title;
            CustomUIExtensions.LabelShadow(_titleLabel);
            _descriptionLabel.Text          = _description;
            _backgroundView.BackgroundColor = Colors.MainBlue;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 public void Configure(string text)
 {
     this.BackgroundColor = Colors.SelectBlue;
     UILabelExtensions.SetupLabelAppearance(_label, text, Colors.White, 16f, UIFontWeight.Medium);
     CustomUIExtensions.LabelShadow(_label);
 }