private void ResetCustomValues() { _badge.ResetCustomization(); _backgroundColorDropDown.SetSpinnerSelection(0); _textColorDropDown.SetSpinnerSelection(0); _fontDropDown.SetSpinnerSelection(0); _letterSpacingDropDown.SetSpinnerSelection(0); _textSizeDropDown.SetSpinnerSelection(0); _cornerRadiusDropDown.SetSpinnerSelection(0); }
private void InitThemeDropDown(CGRect rect) { themeDropDown.InitSource( ThemeTypes.ThemeCollection, (theme) => { _label.GetThemeProvider().SetCurrentTheme(theme); _label.ResetCustomization(); _dropDowns.Except(new[] { themeDropDown }).ToList().ForEach(dropDown => dropDown.ResetValue()); InitSources(rect); UpdateAppearance(); }, Fields.Theme, rect); }
public override void ViewDidLoad() { base.ViewDidLoad(); UpdateAppearance(); _label = new BadgeLabel(); _label.Text = "Label"; _dropDowns = new List <EOSSandboxDropDown>() { backgroundColorDropDown, letterSpaceDropDown, themeDropDown, fontDropDown, textColorDropDown, textSizeDropDown, cornerRadiusDropDown }; View.AddGestureRecognizer(new UITapGestureRecognizer(() => { _dropDowns.ForEach(dropDown => dropDown.CloseInputControl()); })); containerView.ConstrainLayout(() => _label.Frame.GetCenterX() == containerView.Frame.GetCenterX() && _label.Frame.GetCenterY() == containerView.Frame.GetCenterY(), _label); var frame = new CGRect(0, 0, 100, 150); InitThemeDropDown(frame); themeDropDown.SetTextFieldText(_label.GetThemeProvider().GetCurrentTheme() is LightEOSTheme ? "Light" : "Dark"); resetButton.TouchUpInside += (sender, e) => { _label.ResetCustomization(); _dropDowns.Except(new[] { themeDropDown }).ToList().ForEach(dropDown => dropDown.ResetValue()); }; InitSources(frame); }