Пример #1
0
 private void ResetShadowFields(EOSSandboxDropDown shadowOffsetX, EOSSandboxDropDown shadowOffsetY, EOSSandboxDropDown shadowBlur, EOSSandboxDropDown shadowColorDropDown)
 {
     shadowColorDropDown.SetSpinnerSelection(0);
     shadowOffsetX.SetSpinnerSelection(0);
     shadowOffsetY.SetSpinnerSelection(0);
     shadowBlur.SetSpinnerSelection(0);
 }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.BadgeLabelLayout);

            _badge = FindViewById <BadgeLabel>(Resource.Id.badgeLabel);

            _themeDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _backgroundColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.backgroundDropDown);
            _textColorDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.textColorDropDown);
            _fontDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.fontDropDown);
            _letterSpacingDropDown   = FindViewById <EOSSandboxDropDown>(Resource.Id.letterSpacingDropDown);
            _textSizeDropDown        = FindViewById <EOSSandboxDropDown>(Resource.Id.textSizeDropDown);
            _cornerRadiusDropDown    = FindViewById <EOSSandboxDropDown>(Resource.Id.cornerRadiusDropDown);
            var resetButton = FindViewById <Button>(Resource.Id.buttonResetCustomization);

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _backgroundColorDropDown.Name = Fields.Background;
            _backgroundColorDropDown.SetupAdapter(BadgeLabelConstants.BackgroundColors.Select(item => item.Key).ToList());
            _backgroundColorDropDown.ItemSelected += BackgroundColorItemSelected;

            _textColorDropDown.Name = Fields.TextColor;
            _textColorDropDown.SetupAdapter(BadgeLabelConstants.FontColors.Select(item => item.Key).ToList());
            _textColorDropDown.ItemSelected += TextColorItemSelected;

            _fontDropDown.Name = Fields.Font;
            _fontDropDown.SetupAdapter(BadgeLabelConstants.BadgeLabelFonts.Select(item => item.Key).ToList());
            _fontDropDown.ItemSelected += FontItemSelected;

            _letterSpacingDropDown.Name = Fields.LetterSpacing;
            _letterSpacingDropDown.SetupAdapter(BadgeLabelConstants.LetterSpacings.Select(item => item.Key).ToList());
            _letterSpacingDropDown.ItemSelected += LetterSpacingItemSelected;

            _textSizeDropDown.Name = Fields.TextSize;
            _textSizeDropDown.SetupAdapter(BadgeLabelConstants.TextSizes.Select(item => item.Key).ToList());
            _textSizeDropDown.ItemSelected += TextSizeItemSelected;

            _cornerRadiusDropDown.Name = Fields.ConerRadius;
            _cornerRadiusDropDown.SetupAdapter(BadgeLabelConstants.CornerRadiusCollection.Select(item => item.Key).ToList());
            _cornerRadiusDropDown.ItemSelected += CornerRadiusItemSelected;

            SetCurrenTheme(_badge.GetThemeProvider().GetCurrentTheme());

            resetButton.Click += delegate
            {
                ResetCustomValues();
            };
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.WorkTimeActivity);

            _workTime                          = FindViewById <WorkTime>(Resource.Id.workTime);
            _themeDropDown                     = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _titleFontDropDown                 = FindViewById <EOSSandboxDropDown>(Resource.Id.titleFontDropDown);
            _dayTextFontDropDown               = FindViewById <EOSSandboxDropDown>(Resource.Id.dayTextFontDropDown);
            _titleTextSizeDropDown             = FindViewById <EOSSandboxDropDown>(Resource.Id.titleTextSizeDropDown);
            _dayTextSizeDropDown               = FindViewById <EOSSandboxDropDown>(Resource.Id.dayTextSizeDropDown);
            _titleColorDropDown                = FindViewById <EOSSandboxDropDown>(Resource.Id.titleColorDropDown);
            _dayTextColorDropDown              = FindViewById <EOSSandboxDropDown>(Resource.Id.dayTextColorDropDown);
            _currentDayBackgroundColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.currentDayBackgroundColorDropDown);
            _currentDayTextColorDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.currentDayTextColorDropDown);
            _dayEvenBackgroundColorDropDown    = FindViewById <EOSSandboxDropDown>(Resource.Id.dayEvenBackgroundColorDropDown);
            _dividerColorDropDown              = FindViewById <EOSSandboxDropDown>(Resource.Id.dividerColorDropDown);
            _currentDividerColorDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.currentDividerColorDropDown);
            _firstDayOfWeekDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.firstDayOfWeek);
            var resetButton = FindViewById <EOSSandboxButton>(Resource.Id.buttonResetCustomization);

            _customFields = new List <EOSSandboxDropDown>
            {
                _titleFontDropDown,
                _dayTextFontDropDown,
                _titleTextSizeDropDown,
                _dayTextSizeDropDown,
                _titleColorDropDown,
                _dayTextColorDropDown,
                _currentDayBackgroundColorDropDown,
                _currentDayTextColorDropDown,
                _dayEvenBackgroundColorDropDown,
                _dividerColorDropDown,
                _currentDividerColorDropDown,
                _firstDayOfWeekDropDown
            };

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _titleFontDropDown.Name = Fields.TitleFont;
            _titleFontDropDown.SetupAdapter(WorkTimeConstants.TitleFonts.Select(item => item.Key).ToList());
            _titleFontDropDown.ItemSelected += TitleFontItemSelected;

            _dayTextFontDropDown.Name = Fields.DayTextFont;
            _dayTextFontDropDown.SetupAdapter(WorkTimeConstants.DayFonts.Select(item => item.Key).ToList());
            _dayTextFontDropDown.ItemSelected += DayTextFonItemSelected;

            _titleTextSizeDropDown.Name = Fields.TitleTextSize;
            _titleTextSizeDropDown.SetupAdapter(WorkTimeConstants.TitleTextSizes.Select(item => item.Key).ToList());
            _titleTextSizeDropDown.ItemSelected += TitleTextSizeItemSelected;

            _dayTextSizeDropDown.Name = Fields.DayTextSize;
            _dayTextSizeDropDown.SetupAdapter(WorkTimeConstants.DayTextSizes.Select(item => item.Key).ToList());
            _dayTextSizeDropDown.ItemSelected += DayTextSizeItemSelected;

            _titleColorDropDown.Name = Fields.TitleColor;
            _titleColorDropDown.SetupAdapter(WorkTimeConstants.TitleColors.Select(item => item.Key).ToList());
            _titleColorDropDown.ItemSelected += TitleColorItemSelected;

            _dayTextColorDropDown.Name = Fields.DayTextColor;
            _dayTextColorDropDown.SetupAdapter(WorkTimeConstants.DayColors.Select(item => item.Key).ToList());
            _dayTextColorDropDown.ItemSelected += DayTextColorItemSelected;

            _currentDayBackgroundColorDropDown.Name = Fields.CurrentDayBackgroundColor;
            _currentDayBackgroundColorDropDown.SetupAdapter(WorkTimeConstants.CurrentDayBackgroundColors.Select(item => item.Key).ToList());
            _currentDayBackgroundColorDropDown.ItemSelected += CurrentDayBackgroundColorItemSelected;

            _currentDayTextColorDropDown.Name = Fields.CurrentDayTextColor;
            _currentDayTextColorDropDown.SetupAdapter(WorkTimeConstants.CurrentDayColors.Select(item => item.Key).ToList());
            _currentDayTextColorDropDown.ItemSelected += CurrentDayTextColorItemSelected;

            _dayEvenBackgroundColorDropDown.Name = Fields.DayEvenBackgroundColor;
            _dayEvenBackgroundColorDropDown.SetupAdapter(WorkTimeConstants.DayEvenBackgroundColors.Select(item => item.Key).ToList());
            _dayEvenBackgroundColorDropDown.ItemSelected += DayEvenBackgroundColorItemSelected;

            _dividerColorDropDown.Name = Fields.ColorDividers;
            _dividerColorDropDown.SetupAdapter(WorkTimeConstants.DividersColors.Select(item => item.Key).ToList());
            _dividerColorDropDown.ItemSelected += DividerColorItemSelected;

            _currentDividerColorDropDown.Name = Fields.CurrentColorDividers;
            _currentDividerColorDropDown.SetupAdapter(WorkTimeConstants.CurrentDayDividerColors.Select(item => item.Key).ToList());
            _currentDividerColorDropDown.ItemSelected += CurrentDividerColorItemSelected;

            _firstDayOfWeekDropDown.Name = Fields.WeekStartDay;
            _firstDayOfWeekDropDown.SetupAdapter(Days.DaysCollection.Select(item => item.Key).ToList());
            _firstDayOfWeekDropDown.ItemSelected += FirstDayOfWeekItemSelected;

            _workTime.Items = GenerateDaysOfWeekSource();

            SetCurrenTheme(_workTime.GetThemeProvider().GetCurrentTheme());

            resetButton.Click += delegate
            {
                ResetCustomValues();
            };

            ResetViewWhenActivityRecreated(savedInstanceState);
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.InputLayout);

            _inputTop = FindViewById <Input>(Resource.Id.inputTop);
            _inputTop.UpdateAppearance();

            _inputTop.TextChanged += (s, e) =>
            {
                ProceedValidation(_validationKey);
            };

            _inputBottom = FindViewById <Input>(Resource.Id.inputBottom);
            _inputBottom.UpdateAppearance();

            _inputBottom.TextChanged += (s, e) =>
            {
                ProceedValidation(_validationKey);
            };

            _themeDropDown                   = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _fontDropDown                    = FindViewById <EOSSandboxDropDown>(Resource.Id.fontDropDown);
            _letterSpacingDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.letterSpacingDropDown);
            _textSizeDropDown                = FindViewById <EOSSandboxDropDown>(Resource.Id.textSizeDropDown);
            _textColorDropDown               = FindViewById <EOSSandboxDropDown>(Resource.Id.textColorDropDown);
            _textColorDisabledDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledTextColorDropDown);
            _hintTextColorDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.hintTextColorDropDown);
            _hintTextColorDisabledDropDown   = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledHintTextColorDropDown);
            _leftDrawableDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.iconDropDown);
            _focusedColorDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.focusedColorDropDown);
            _disabledColorDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledColorDropDown);
            _normalUnderlineColorDropDown    = FindViewById <EOSSandboxDropDown>(Resource.Id.normalUnderlineColorDropDown);
            _normalIconColorDropDown         = FindViewById <EOSSandboxDropDown>(Resource.Id.normalIconColorDropDown);
            _populatedUnderlineColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.populatedUnderlineColorDropDown);
            _populatedIconColorDropDown      = FindViewById <EOSSandboxDropDown>(Resource.Id.populatedIconColorDropDown);
            _validatedRulesDropDown          = FindViewById <EOSSandboxDropDown>(Resource.Id.validationRulesDropDown);
            var resetButton = FindViewById <Button>(Resource.Id.buttonResetCustomization);

            _disabledSwitch = FindViewById <Switch>(Resource.Id.switchDisabled);

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _fontDropDown.Name = Fields.Font;
            _fontDropDown.SetupAdapter(InputConstants.InputFonts.Select(item => item.Key).ToList());
            _fontDropDown.ItemSelected += FontItemSelected;

            _letterSpacingDropDown.Name = Fields.LetterSpacing;
            _letterSpacingDropDown.SetupAdapter(InputConstants.LetterSpacings.Select(item => item.Key).ToList());
            _letterSpacingDropDown.ItemSelected += LetterSpacingItemSelected;

            _textSizeDropDown.Name = Fields.TextSize;
            _textSizeDropDown.SetupAdapter(InputConstants.TextSizes.Select(item => item.Key).ToList());
            _textSizeDropDown.ItemSelected += TextSizeView_ItemSelected;

            _textColorDropDown.Name = Fields.TextColor;
            _textColorDropDown.SetupAdapter(InputConstants.FontColors.Select(item => item.Key).ToList());
            _textColorDropDown.ItemSelected += TextColorItemSelected;

            _textColorDisabledDropDown.Name = Fields.DisabledTextColor;
            _textColorDisabledDropDown.SetupAdapter(InputConstants.DisabledFontColors.Select(item => item.Key).ToList());
            _textColorDisabledDropDown.ItemSelected += TextColorDisabledItemSelected;

            _hintTextColorDropDown.Name = Fields.HintTextColor;
            _hintTextColorDropDown.SetupAdapter(InputConstants.PlaceholderColors.Select(item => item.Key).ToList());
            _hintTextColorDropDown.ItemSelected += HintTextColorItemSelected;

            _hintTextColorDisabledDropDown.Name = Fields.HintTextColorDisabled;
            _hintTextColorDisabledDropDown.SetupAdapter(InputConstants.DisabledPlaceholderColors.Select(item => item.Key).ToList());
            _hintTextColorDisabledDropDown.ItemSelected += HintTextColorDisabledItemSelected;

            _leftDrawableDropDown.Name = Fields.Icon;
            _leftDrawableDropDown.SetupAdapter(Icons.DrawableCollection.Select(item => item.Key).ToList());
            _leftDrawableDropDown.ItemSelected += LeftDrawableItemSelected;

            _focusedColorDropDown.Name = Fields.FocusedColor;
            _focusedColorDropDown.SetupAdapter(InputConstants.FocusedColors.Select(item => item.Key).ToList());
            _focusedColorDropDown.ItemSelected += FocusedColorItemSelected;

            _disabledColorDropDown.Name = Fields.DisabledColor;
            _disabledColorDropDown.SetupAdapter(InputConstants.DisabledColors.Select(item => item.Key).ToList());
            _disabledColorDropDown.ItemSelected += DisabledColorItemSelected;

            _normalUnderlineColorDropDown.Name = Fields.NormalUnderlineColor;
            _normalUnderlineColorDropDown.SetupAdapter(InputConstants.UnderlineColors.Select(item => item.Key).ToList());
            _normalUnderlineColorDropDown.ItemSelected += NormalUnderlineColorItemSelected;

            _normalIconColorDropDown.Name = Fields.NormalIconColor;
            _normalIconColorDropDown.SetupAdapter(InputConstants.IconColors.Select(item => item.Key).ToList());
            _normalIconColorDropDown.ItemSelected += NormalIconColorItemSelected;

            _populatedIconColorDropDown.Name = Fields.PopulatedIconColor;
            _populatedIconColorDropDown.SetupAdapter(InputConstants.PopulatedIconColors.Select(item => item.Key).ToList());
            _populatedIconColorDropDown.ItemSelected += PopulatedIconColorItemSelected;

            _populatedUnderlineColorDropDown.Name = Fields.PopulatedUnderlineColor;
            _populatedUnderlineColorDropDown.SetupAdapter(InputConstants.PopulatedUnderlineColors.Select(item => item.Key).ToList());
            _populatedUnderlineColorDropDown.ItemSelected += PopulatedUnderlineColorItemSelected;

            _validatedRulesDropDown.Name = Fields.ValidationRules;
            _validatedRulesDropDown.SetupAdapter(Validation.ValidationCollection.Select(item => item.Key).ToList());
            _validatedRulesDropDown.ItemSelected += ValidatedRulesItemSelected;

            SetCurrenTheme(_inputTop.GetThemeProvider().GetCurrentTheme());

            resetButton.Click += delegate
            {
                ResetCustomValues();
            };

            _disabledSwitch.SetOnCheckedChangeListener(this);

            Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
        }
Пример #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SimpleButtonLayout);

            _simpleButton                    = FindViewById <SimpleButton>(Resource.Id.simpleButton);
            _themeDropDown                   = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _fontDropDown                    = FindViewById <EOSSandboxDropDown>(Resource.Id.fontDropDown);
            _letterSpacingDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.letterSpacingDropDown);
            _textSizeDropDown                = FindViewById <EOSSandboxDropDown>(Resource.Id.textSizeDropDown);
            _textColorEnabledDropDown        = FindViewById <EOSSandboxDropDown>(Resource.Id.enabledTextColorDropDown);
            _textColorDisabledDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledTextColorDropDown);
            _backgroundColorEnabledDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.enabledBackgroundDropDown);
            _backgroundColorDisabledDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledBackgroundDropDown);
            _backgroundColorPressedDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.pressedBackgroundDropDown);
            _cornerRadiusDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.cornerRadiusDropDown);
            _rippleColorDropDown             = FindViewById <EOSSandboxDropDown>(Resource.Id.rippleColorDropDown);
            var resetButton   = FindViewById <Button>(Resource.Id.buttonResetCustomization);
            var disableSwitch = FindViewById <Switch>(Resource.Id.switchDisabled);

            _buttonTypeDropDown   = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTypeDropDown);
            _shadowRadiusDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.shadowRadiusDropDown);

            _shadowRadiusDropDown.Name = Fields.ShadowRadius;
            _shadowRadiusDropDown.SetupAdapter(SimpleButtonConstants.ShadowRadiusCollection.Select(item => item.Key).ToList());
            _shadowRadiusDropDown.ItemSelected += ShadowRadiusItemSelected;

            _buttonTypeDropDown.Visibility = ViewStates.Visible;
            _buttonTypeDropDown.Name       = Fields.ButtonType;
            _buttonTypeDropDown.SetupAdapter(Buttons.SimpleButtonTypeCollection.Select(item => item.Key).ToList());
            _buttonTypeDropDown.ItemSelected += ButtonTypeItemSelected;

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _fontDropDown.Name = Fields.Font;
            _fontDropDown.SetupAdapter(SimpleButtonConstants.SimpleButtonFonts.Select(item => item.Key).ToList());
            _fontDropDown.ItemSelected += FontSpinner_ItemSelected;

            _letterSpacingDropDown.Name = Fields.LetterSpacing;
            _letterSpacingDropDown.SetupAdapter(SimpleButtonConstants.LetterSpacings.Select(item => item.Key).ToList());
            _letterSpacingDropDown.ItemSelected += LetterSpacingView_ItemSelected;

            _textSizeDropDown.Name = Fields.TextSize;
            _textSizeDropDown.SetupAdapter(SimpleButtonConstants.TextSizes.Select(item => item.Key).ToList());
            _textSizeDropDown.ItemSelected += TextSizeItemSelected;

            _textColorEnabledDropDown.Name = Fields.EnabledTextColor;
            _textColorEnabledDropDown.SetupAdapter(SimpleButtonConstants.FontColors.Select(item => item.Key).ToList());
            _textColorEnabledDropDown.ItemSelected += TextColorEnabledItemSelected;

            _textColorDisabledDropDown.Name = Fields.DisabledTextColor;
            _textColorDisabledDropDown.SetupAdapter(SimpleButtonConstants.DisabledFontColors.Select(item => item.Key).ToList());
            _textColorDisabledDropDown.ItemSelected += TextColorDisabledItemSelected;

            _backgroundColorEnabledDropDown.Name = Fields.EnabledBackground;
            _backgroundColorEnabledDropDown.SetupAdapter(SimpleButtonConstants.BackgroundColors.Select(item => item.Key).ToList());
            _backgroundColorEnabledDropDown.ItemSelected += BackgroundColorEnabledItemSelected;

            _backgroundColorDisabledDropDown.Name = Fields.DisabledBackground;
            _backgroundColorDisabledDropDown.SetupAdapter(SimpleButtonConstants.DisabledBackgroundColors.Select(item => item.Key).ToList());
            _backgroundColorDisabledDropDown.ItemSelected += BackgroundColorDisabledItemSelected;

            _backgroundColorPressedDropDown.Name = Fields.PressedBackground;
            _backgroundColorPressedDropDown.SetupAdapter(SimpleButtonConstants.PressedBackgroundColors.Select(item => item.Key).ToList());
            _backgroundColorPressedDropDown.ItemSelected += BackgroundColorPressedItemSelected;

            _cornerRadiusDropDown.Name = Fields.ConerRadius;
            _cornerRadiusDropDown.SetupAdapter(SimpleButtonConstants.CornerRadiusCollection.Select(item => item.Key).ToList());
            _cornerRadiusDropDown.ItemSelected += CornerRadiurSpinner_ItemSelected;

            _rippleColorDropDown.Name = Fields.RippleColor;
            _rippleColorDropDown.SetupAdapter(SimpleButtonConstants.RippleColors.Select(item => item.Key).ToList());
            _rippleColorDropDown.ItemSelected += RippleColorItemSelected;

            resetButton.Click += delegate
            {
                SetupSimpleButtonStyle();
                EnableSimpleButtonFields();
                _simpleButton.ResetCustomization();
                ResetCustomValues();
            };

            disableSwitch.SetOnCheckedChangeListener(this);

            SetCurrenTheme(_simpleButton.GetThemeProvider().GetCurrentTheme());

            SetupSimpleButtonStyle();
            EnableSimpleButtonFields();
        }
Пример #6
0
 private void ResetCustomization(FabProgress fab, EOSSandboxDropDown themeDropDown, List <EOSSandboxDropDown> spinners)
 {
     spinners.Except(new[] { themeDropDown }).ToList().ForEach(s => s.SetSpinnerSelection(0));
     fab.ResetCustomization();
 }
Пример #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SimpleButtonLayout);

            _CTAButton = FindViewById <SimpleButton>(Resource.Id.simpleButton);
            _CTAButton.UpdateAppearance();
            _CTAButton.Text = "CTA button";

            _CTAButton.Click += async(s, e) =>
            {
                if (_CTAButton.InProgress)
                {
                    return;
                }
                _CTAButton.StartProgressAnimation();
                ToggleEnableState();
                await Task.Delay(5000);

                _CTAButton.StopProgressAnimation();
                ToggleEnableState();
            };

            _themeDropDown        = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _cornerRadiusDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.cornerRadiusDropDown);
            var fontDropDown                    = FindViewById <EOSSandboxDropDown>(Resource.Id.fontDropDown);
            var letterSpacingDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.letterSpacingDropDown);
            var textSizeDropDown                = FindViewById <EOSSandboxDropDown>(Resource.Id.textSizeDropDown);
            var textColorEnabledDropDown        = FindViewById <EOSSandboxDropDown>(Resource.Id.enabledTextColorDropDown);
            var textColorDisabledDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledTextColorDropDown);
            var backgroundColorEnabledDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.enabledBackgroundDropDown);
            var backgroundColorDisabledDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledBackgroundDropDown);
            var backgroundColorPressedDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.pressedBackgroundDropDown);
            var rippleColorDropDown             = FindViewById <EOSSandboxDropDown>(Resource.Id.rippleColorDropDown);

            _resetButton          = FindViewById <Button>(Resource.Id.buttonResetCustomization);
            _disableSwitch        = FindViewById <Switch>(Resource.Id.switchDisabled);
            _buttonTypeDropDown   = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTypeDropDown);
            _shadowRadiusDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.shadowRadiusDropDown);

            _dropDowns = new List <EOSSandboxDropDown>
            {
                _themeDropDown,
                fontDropDown,
                letterSpacingDropDown,
                textSizeDropDown,
                textColorEnabledDropDown,
                textColorDisabledDropDown,
                backgroundColorEnabledDropDown,
                backgroundColorDisabledDropDown,
                backgroundColorPressedDropDown,
                _cornerRadiusDropDown,
                rippleColorDropDown,
                _shadowRadiusDropDown,
                _buttonTypeDropDown
            };

            _shadowRadiusDropDown.Name = Fields.ShadowRadius;
            _shadowRadiusDropDown.SetupAdapter(SimpleButtonConstants.ShadowRadiusCollection.Select(item => item.Key).ToList());
            _shadowRadiusDropDown.ItemSelected += ShadowRadiusItemSelected;

            _buttonTypeDropDown.Visibility = ViewStates.Visible;
            _buttonTypeDropDown.Name       = Fields.ButtonType;
            _buttonTypeDropDown.SetupAdapter(Buttons.CTAButtonTypeCollection.Select(item => item.Key).ToList());
            _buttonTypeDropDown.ItemSelected += ButtonTypeItemSelected;

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            fontDropDown.Name = Fields.Font;
            fontDropDown.SetupAdapter(SimpleButtonConstants.SimpleButtonFonts.Select(item => item.Key).ToList());
            fontDropDown.ItemSelected += FontItemSelected;

            letterSpacingDropDown.Name = Fields.LetterSpacing;
            letterSpacingDropDown.SetupAdapter(SimpleButtonConstants.LetterSpacings.Select(item => item.Key).ToList());
            letterSpacingDropDown.ItemSelected += LetterSpacingItemSelected;

            textSizeDropDown.Name = Fields.TextSize;
            textSizeDropDown.SetupAdapter(SimpleButtonConstants.TextSizes.Select(item => item.Key).ToList());
            textSizeDropDown.ItemSelected += TextSizeItemSelected;

            textColorEnabledDropDown.Name = Fields.EnabledTextColor;
            textColorEnabledDropDown.SetupAdapter(SimpleButtonConstants.FontColors.Select(item => item.Key).ToList());
            textColorEnabledDropDown.ItemSelected += TextColorEnabledItemSelected;

            textColorDisabledDropDown.Name = Fields.DisabledTextColor;
            textColorDisabledDropDown.SetupAdapter(SimpleButtonConstants.DisabledFontColors.Select(item => item.Key).ToList());
            textColorDisabledDropDown.ItemSelected += TextColorDisabledItemSelected;

            backgroundColorEnabledDropDown.Name = Fields.EnabledBackground;
            backgroundColorEnabledDropDown.SetupAdapter(SimpleButtonConstants.BackgroundColors.Select(item => item.Key).ToList());
            backgroundColorEnabledDropDown.ItemSelected += BackgroundColorEnabledItemSelected;

            backgroundColorDisabledDropDown.Name = Fields.DisabledBackground;
            backgroundColorDisabledDropDown.SetupAdapter(SimpleButtonConstants.DisabledBackgroundColors.Select(item => item.Key).ToList());
            backgroundColorDisabledDropDown.ItemSelected += BackgroundColorDisabledItemSelected;

            backgroundColorPressedDropDown.Name = Fields.PressedBackground;
            backgroundColorPressedDropDown.SetupAdapter(SimpleButtonConstants.PressedBackgroundColors.Select(item => item.Key).ToList());
            backgroundColorPressedDropDown.ItemSelected += BackgroundColorPressedItemSelected;

            _cornerRadiusDropDown.Name = Fields.ConerRadius;
            _cornerRadiusDropDown.SetupAdapter(SimpleButtonConstants.CornerRadiusCollection.Select(item => item.Key).ToList());
            _cornerRadiusDropDown.ItemSelected += CornerRadiusItemSelected;

            rippleColorDropDown.Name = Fields.RippleColor;
            rippleColorDropDown.SetupAdapter(SimpleButtonConstants.RippleColors.Select(item => item.Key).ToList());
            rippleColorDropDown.ItemSelected += RippleColorItemSelected;

            _resetButton.Click += delegate
            {
                SetupSimpleButtonStyle();
                EnableSimpleButtonFields();
                _CTAButton.ResetCustomization();
                ResetCustomValues();
            };

            _disableSwitch.SetOnCheckedChangeListener(this);

            SetCurrenTheme(_CTAButton.GetThemeProvider().GetCurrentTheme());

            SetupSimpleButtonStyle();
            EnableSimpleButtonFields();
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SectionLayout);

            _sectionRecyclerView = FindViewById <RecyclerView>(Resource.Id.sectionRecyclerView);
            var layoutManager = new LinearLayoutManager(BaseContext);

            _sectionRecyclerView.SetLayoutManager(layoutManager);

            _toast = Toast.MakeText(BaseContext, "Action invoked", ToastLength.Short);

            var defaultModel = new SectionModel()
            {
                SectionAction = () => { _toast.Show(); },
                HasBorder     = (bool)EOSThemeProvider.Instance.GetCurrentTheme().ThemeValues[EOSConstants.HasSectionBorder],
                HasButton     = (bool)EOSThemeProvider.Instance.GetCurrentTheme().ThemeValues[EOSConstants.HasSectionAction]
            };

            _dataSource = new List <object>()
            {
                defaultModel,
                "Terms of Use",
                "Privacy Policy",
                "About Us"
            };

            var adapter = new SectionAdapter(_dataSource);

            _sectionRecyclerView.SetAdapter(adapter);

            _themeDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _sectionNameDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.sectionNameDropDown);
            _buttonTextDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTextDropDown);
            _sectionFontDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.sectionNameFontDropDown);
            _buttonFontDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTextFontDropDown);
            _sectionNameLetterSpacingDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.sectionNameLetterSpacingDropDown);
            _buttonTextLetterSpacingDropDown  = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTextLetterSpacingDropDown);
            _sectionTextSizeDropDown          = FindViewById <EOSSandboxDropDown>(Resource.Id.sectionTextSizeDropDown);
            _buttonTextSizeDropDown           = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTextSizeDropDown);
            _sectionTextColorDropDown         = FindViewById <EOSSandboxDropDown>(Resource.Id.sectionTextColorDropDown);
            _buttonTextColorDropDown          = FindViewById <EOSSandboxDropDown>(Resource.Id.buttonTextColorDropDown);
            _backgroundColorDropDown          = FindViewById <EOSSandboxDropDown>(Resource.Id.backgroundColorDropDown);
            _borderColorDropDown      = FindViewById <EOSSandboxDropDown>(Resource.Id.borderColorDropDown);
            _borderWidthDropDown      = FindViewById <EOSSandboxDropDown>(Resource.Id.borderWidthDropDown);
            _paddingTopDropDown       = FindViewById <EOSSandboxDropDown>(Resource.Id.paddingTopDropDown);
            _paddingBottomDropDown    = FindViewById <EOSSandboxDropDown>(Resource.Id.paddingBottomDropDown);
            _paddingLeftDropDown      = FindViewById <EOSSandboxDropDown>(Resource.Id.paddingLeftDropDown);
            _paddingRightDropDown     = FindViewById <EOSSandboxDropDown>(Resource.Id.paddingRightDropDown);
            _hasBorderSwitch          = FindViewById <Switch>(Resource.Id.switchHasBorder);
            _hasButtonSwitch          = FindViewById <Switch>(Resource.Id.switchHasButton);
            _resetCustomizationButton = FindViewById <Button>(Resource.Id.buttonResetCustomization);

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _sectionNameDropDown.Name = Fields.SectionName;
            _sectionNameDropDown.SetupAdapter(Titles.TitleCollection.Select(item => item.Key).ToList());
            _sectionNameDropDown.ItemSelected += SectionNameItemSelected;

            _buttonTextDropDown.Name = Fields.ButtonText;
            _buttonTextDropDown.SetupAdapter(Titles.TitleCollection.Select(item => item.Key).ToList());
            _buttonTextDropDown.ItemSelected += ButtonTextItemSelected;

            _sectionNameLetterSpacingDropDown.Name = Fields.SectionNameLetterSpacing;
            _sectionNameLetterSpacingDropDown.SetupAdapter(SectionConstants.SectionLetterSpacings.Select(item => item.Key).ToList());
            _sectionNameLetterSpacingDropDown.ItemSelected += SectionNameLetterSpacingItemSelected;

            _buttonTextLetterSpacingDropDown.Name = Fields.ButtonTextLetterSpacing;
            _buttonTextLetterSpacingDropDown.SetupAdapter(SectionConstants.ButtonLetterSpacings.Select(item => item.Key).ToList());
            _buttonTextLetterSpacingDropDown.ItemSelected += ButtonTextLetterSpacingItemSelected;

            _sectionTextSizeDropDown.Name = Fields.SectionTextSize;
            _sectionTextSizeDropDown.SetupAdapter(SectionConstants.SectionTextSizes.Select(item => item.Key).ToList());
            _sectionTextSizeDropDown.ItemSelected += SectionTextSizeItemSelected;

            _buttonTextSizeDropDown.Name = Fields.ButtonTextSize;
            _buttonTextSizeDropDown.SetupAdapter(SectionConstants.ButtonTextSizes.Select(item => item.Key).ToList());
            _buttonTextSizeDropDown.ItemSelected += ButtonTextSizeItemSelected;

            _sectionTextColorDropDown.Name = Fields.SectionTextColor;
            _sectionTextColorDropDown.SetupAdapter(SectionConstants.SectionTextColors.Select(item => item.Key).ToList());
            _sectionTextColorDropDown.ItemSelected += SectionTextColorItemSelected;

            _buttonTextColorDropDown.Name = Fields.ButtonTextColor;
            _buttonTextColorDropDown.SetupAdapter(SectionConstants.ButtonTextColors.Select(item => item.Key).ToList());
            _buttonTextColorDropDown.ItemSelected += ButtonTextColorItemSelected;

            _backgroundColorDropDown.Name = Fields.BackgroundColor;
            _backgroundColorDropDown.SetupAdapter(SectionConstants.BackgroundsColors.Select(item => item.Key).ToList());
            _backgroundColorDropDown.ItemSelected += BackgroundColorItemSelected;

            _borderColorDropDown.Name = Fields.BorderColor;
            _borderColorDropDown.SetupAdapter(SectionConstants.BorderColors.Select(item => item.Key).ToList());
            _borderColorDropDown.ItemSelected += BorderColorItemSelected;

            _borderWidthDropDown.Name = Fields.BorderWidth;
            _borderWidthDropDown.SetupAdapter(SectionConstants.BorderWidth.Select(item => item.Key).ToList());
            _borderWidthDropDown.ItemSelected += BorderWidthItemSelected;

            _paddingTopDropDown.Name = Fields.PaddingTop;
            _paddingTopDropDown.SetupAdapter(SectionConstants.TopPaddings.Select(item => item.Key).ToList());
            _paddingTopDropDown.ItemSelected += PaddingTopItemSelected;

            _paddingBottomDropDown.Name = Fields.PaddingBottom;
            _paddingBottomDropDown.SetupAdapter(SectionConstants.BottomPaddings.Select(item => item.Key).ToList());
            _paddingBottomDropDown.ItemSelected += PaddingBottomItemSelected;

            _paddingLeftDropDown.Name = Fields.PaddingLeft;
            _paddingLeftDropDown.SetupAdapter(SectionConstants.LeftPaddings.Select(item => item.Key).ToList());
            _paddingLeftDropDown.ItemSelected += PaddingLeftItemSelected;

            _paddingRightDropDown.Name = Fields.PaddingRight;
            _paddingRightDropDown.SetupAdapter(SectionConstants.RightPaddings.Select(item => item.Key).ToList());
            _paddingRightDropDown.ItemSelected += PaddingRightItemSelected;

            _sectionFontDropDown.Name = Fields.SectionNameFont;
            _sectionFontDropDown.SetupAdapter(SectionConstants.SectionFonts.Select(item => item.Key).ToList());
            _sectionFontDropDown.ItemSelected += SectionFontItemSelected;

            _buttonFontDropDown.Name = Fields.ButtonTextFont;
            _buttonFontDropDown.SetupAdapter(SectionConstants.ButtonFonts.Select(item => item.Key).ToList());
            _buttonFontDropDown.ItemSelected += ButtonFontItemSelected;

            _hasBorderSwitch.CheckedChange += HasBorderSwitch_CheckedChange;

            _hasButtonSwitch.CheckedChange += HasButtonSwitch_CheckedChange;

            _resetCustomizationButton.Click += ResetCustomizationClick;

            SetCurrenTheme(EOSThemeProvider.Instance.GetCurrentTheme());
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.CircleMenuLayout);

            _circleMenu = new CircleMenu(BaseContext);
            _circleMenu.Attach(Window.DecorView.FindViewById(Android.Resource.Id.Content) as ViewGroup);

            _iconsDictionary = new Dictionary <int, int>()
            {
                { 1, Resource.Drawable.SwitchIcon },
                { 2, Resource.Drawable.CameraIcon },
                { 3, Resource.Drawable.ShutterIcon },
                { 4, Resource.Drawable.TimerIcon },
                { 5, Resource.Drawable.BushIcon },
                { 6, Resource.Drawable.DurationIcon },
                { 7, Resource.Drawable.EffectsIcon },
                { 8, Resource.Drawable.HealIcon },
                { 9, Resource.Drawable.MasksIcon },
                { 101, Resource.Drawable.WidescreenIcon },
                { 102, Resource.Drawable.OneToOneIcon },
                { 103, Resource.Drawable.HDRIcon },
            };

            _circleMenu.CircleMenuItems = GenerateSource(9);

            _circleMenu.Clicked += (s, index) =>
            {
                var intent = new Intent(this, typeof(CircleMenuItemActivity));
                intent.PutExtra("logoId", _iconsDictionary.GetValueOrDefault(index));
                StartActivity(intent);
            };

            _themeDropDown                = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown);
            _mainColorDropDown            = FindViewById <EOSSandboxDropDown>(Resource.Id.mainColor);
            _focusedMainColorDropDown     = FindViewById <EOSSandboxDropDown>(Resource.Id.focusedMainColor);
            _focusedButtonColorDropDown   = FindViewById <EOSSandboxDropDown>(Resource.Id.focusedButtonColor);
            _unfocusedButtonColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.unfocusedButtonColor);
            _circleMenuItemsDropDown      = FindViewById <EOSSandboxDropDown>(Resource.Id.circleMenuItems);
            var resetButton = FindViewById <Button>(Resource.Id.buttonResetCustomization);

            _themeDropDown.Name = Fields.Theme;
            _themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList());
            _themeDropDown.ItemSelected += ThemeItemSelected;

            _mainColorDropDown.Name = Fields.UnfocusedBackgroundColor;
            _mainColorDropDown.SetupAdapter(CircleMenuConstants.UnfocusedBackgroundColors.Select(item => item.Key).ToList());
            _mainColorDropDown.ItemSelected += MainColorItemSelected;

            _focusedMainColorDropDown.Name = Fields.FocusedBackgroundColor;
            _focusedMainColorDropDown.SetupAdapter(CircleMenuConstants.FocusedBackgroundColors.Select(item => item.Key).ToList());
            _focusedMainColorDropDown.ItemSelected += FocusedMainColorItemSelected;

            _focusedButtonColorDropDown.Name = Fields.FocusedIconColor;
            _focusedButtonColorDropDown.SetupAdapter(CircleMenuConstants.FocusedIconColors.Select(item => item.Key).ToList());
            _focusedButtonColorDropDown.ItemSelected += FocusedButtonColorItemSelected;

            _unfocusedButtonColorDropDown.Name = Fields.UnfocusedIconColor;
            _unfocusedButtonColorDropDown.SetupAdapter(CircleMenuConstants.UnfocusedIconColors.Select(item => item.Key).ToList());
            _unfocusedButtonColorDropDown.ItemSelected += UnfocusedButtonColorItemSelected;

            _circleMenuItemsDropDown.Name = Fields.CircleMenuItems;
            _circleMenuItemsDropDown.SetupAdapter(CircleMenuSource.SourceCollection.Select(item => item.Key).ToList());
            _circleMenuItemsDropDown.ItemSelected += CircleMenuItemsItemSelected;

            resetButton.Click += delegate
            {
                ResetCustomValues();
            };

            SetCurrenTheme(_circleMenu.GetThemeProvider().GetCurrentTheme());
        }