private void ResetCustomValues()
 {
     _simpleLabel.ResetCustomization();
     _textColorDropDown.SetSpinnerSelection(0);
     _fontDropDown.SetSpinnerSelection(0);
     _letterSpacingDropDown.SetSpinnerSelection(0);
     _textSizeDropDown.SetSpinnerSelection(0);
 }
Beispiel #2
0
 private void InitThemeDropDown(CGRect rect)
 {
     themesDropDown.InitSource(
         ThemeTypes.ThemeCollection,
         (theme) =>
     {
         _simpleLabel.GetThemeProvider().SetCurrentTheme(theme);
         _simpleLabel.ResetCustomization();
         _dropDowns.Except(new[] { themesDropDown }).ToList().ForEach(dropDown => dropDown.ResetValue());
         InitSources(rect);
         UpdateAppearance();
     },
         Fields.Theme,
         rect);
     themesDropDown.SetTextFieldText(_simpleLabel.GetThemeProvider().GetCurrentTheme() is LightEOSTheme ? "Light" : "Dark");
 }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _simpleLabel = new SimpleLabel
            {
                Text = "Label"
            };

            _dropDowns = new List <EOSSandboxDropDown>()
            {
                themesDropDown,
                fontDropDown,
                textColorDropDown,
                textSizeDropDown,
                letterSpacingDropDown
            };

            View.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                _dropDowns.ForEach(field => field.CloseInputControl());
            }));
            _simpleLabel.TextAlignment = UITextAlignment.Center;
            containerView.ConstrainLayout(() => _simpleLabel.Frame.GetCenterY() == containerView.Frame.GetCenterY() &&
                                          _simpleLabel.Frame.Left == containerView.Frame.Left &&
                                          _simpleLabel.Frame.Right == containerView.Frame.Right, _simpleLabel);

            var rect = new CGRect(0, 0, 100, 150);

            InitThemeDropDown(rect);
            InitSources(rect);
            resetButton.TouchUpInside += (sender, e) =>
            {
                _simpleLabel.ResetCustomization();
                _dropDowns.Except(new [] { themesDropDown }).ToList().ForEach(d => d.ResetValue());
            };
        }