void ReleaseDesignerOutlets()
        {
            if (AuthorLabel != null)
            {
                AuthorLabel.Dispose();
                AuthorLabel = null;
            }

            if (BadgeLabel != null)
            {
                BadgeLabel.Dispose();
                BadgeLabel = null;
            }

            if (BadgeView != null)
            {
                BadgeView.Dispose();
                BadgeView = null;
            }

            if (ContentLabel != null)
            {
                ContentLabel.Dispose();
                ContentLabel = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }
        }
예제 #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();
            };
        }
        void ReleaseDesignerOutlets()
        {
            if (OverlayView != null)
            {
                OverlayView.Dispose();
                OverlayView = null;
            }

            if (BadgeView != null)
            {
                BadgeView.Dispose();
                BadgeView = null;
            }

            if (BadgeLabel != null)
            {
                BadgeLabel.Dispose();
                BadgeLabel = null;
            }

            if (AmountLabel != null)
            {
                AmountLabel.Dispose();
                AmountLabel = null;
            }

            if (ItemImageView != null)
            {
                ItemImageView.Dispose();
                ItemImageView = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (TotalPriceLabel != null)
            {
                TotalPriceLabel.Dispose();
                TotalPriceLabel = null;
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
        void ReleaseDesignerOutlets()
        {
            if (BadgeLabel != null)
            {
                BadgeLabel.Dispose();
                BadgeLabel = null;
            }

            if (BadgeView != null)
            {
                BadgeView.Dispose();
                BadgeView = null;
            }

            if (DateLabel != null)
            {
                DateLabel.Dispose();
                DateLabel = null;
            }

            if (ProductImageView != null)
            {
                ProductImageView.Dispose();
                ProductImageView = null;
            }

            if (ProductTitleLabel != null)
            {
                ProductTitleLabel.Dispose();
                ProductTitleLabel = null;
            }

            if (ReviewTextLabel != null)
            {
                ReviewTextLabel.Dispose();
                ReviewTextLabel = null;
            }
        }
예제 #6
0
 /// <summary>Prevents a default instance of the <see cref="VisualBadge" /> class from being created.</summary>
 private VisualBadge()
 {
     _badgeLabel = new BadgeLabel();
 }
예제 #7
0
 protected virtual void SetupBadge()
 {
     BadgeLabel.SetupStyle(ThemeConfig.ReviewCell.Badge);
     BadgeView.BackgroundColor    = ThemeConfig.MyReviewCell.Badge.Background.ToUIColor();
     BadgeView.Layer.CornerRadius = (float)ThemeConfig.MyReviewCell.Badge.Layer.CornerRadius;
 }