protected virtual void CreateItems()
        {
            var vm = ((ITotalScoreItemVm)this.DataContext);

            for (var i = 1; i <= vm.MaxValue; i++)
            {
                var scoreItemView = new UIView(frame: new CGRect(0, 0, ScoreView.Frame.Height, ScoreView.Frame.Height));
                scoreItemView.Tag                = i;
                scoreItemView.BackgroundColor    = ThemeConfig.ReviewPost.Score.BackgroundColor.ToUIColor();
                scoreItemView.Layer.CornerRadius = scoreItemView.Frame.Height / 2;
                scoreItemView.ActionOnTap(() =>
                {
                    SelectView(scoreItemView);
                });
                ScoreView.AddSubview(scoreItemView);

                var scoreItemLabel = new AppRopio.Base.iOS.Controls.ARLabel(frame: scoreItemView.Bounds);
                scoreItemLabel.Text          = i.ToString();
                scoreItemLabel.TextAlignment = UITextAlignment.Center;
                scoreItemLabel.SetupStyle(ThemeConfig.ReviewPost.ScoreValue);
                scoreItemView.AddSubview(scoreItemLabel);

                if (i == vm.Value)
                {
                    SelectView(scoreItemView);
                }
            }
        }
Example #2
0
        public virtual CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
        {
            var item = GetItemAt(indexPath) as ICategoriesItemVM;

            var size = new CGSize((nfloat)ThemeConfig.Categories.TabCell.Size.Width, (nfloat)ThemeConfig.Categories.TabCell.Size.Height);

            if (item != null)
            {
                var label = new AppRopio.Base.iOS.Controls.ARLabel()
                            .WithFrame(0, 0, 0, (nfloat)ThemeConfig.Categories.TabCell.Size.Height)
                            .WithTune(tune =>
                {
                    tune.SetupStyle(ThemeConfig.Categories.TabCell.Title);
                    tune.Text = item.Name;
                });

                label.SetupStyle(ThemeConfig.Categories.TabCell.Title);
                label.SizeToFit();

                var width = label.Frame.Width + 24;
                size = new CGSize(width, (nfloat)ThemeConfig.Categories.TabCell.Size.Height);
            }

            return(size);
        }
        internal static float GetHeightForContent(string text)
        {
            var label = new AppRopio.Base.iOS.Controls.ARLabel {
                Frame = new CGRect(16, 52, DeviceInfo.ScreenWidth - 32, 0), Text = text, Lines = 0
            };

            label.SetupStyle(Mvx.Resolve <IProductsThemeConfigService>().ThemeConfig.ProductDetails.DetailsCell.MultiLineText.Value);

            label.SizeToFit();

            return((float)(MULTILINE_TEXT_HEIGHT + label.Frame.Height + DEFAULT_OFFSET * 2));
        }
        public override UIView GetView(UIPickerView pickerView, nint row, nint component, UIView view)
        {
            var label = new AppRopio.Base.iOS.Controls.ARLabel(new CGRect(0, 0, pickerView.Bounds.Width / 2, 32))
            {
                Text  = GetTitle(pickerView, row, component),
                Lines = 0
            };

            label.SetupStyle(ThemeConfig.Title);
            label.SizeToFit();

            return(label);
        }
Example #5
0
            public override UIView GetView(UIPickerView pickerView, nint row, nint component, UIView view)
            {
                var item  = ItemsSource.ElementAt((int)row) as PickerCollectionItemVM;
                var label = new AppRopio.Base.iOS.Controls.ARLabel()
                            .WithFrame(0, 0, pickerView.Bounds.Width, GetRowHeight(pickerView, component))
                            .WithTune(tune =>
                {
                    tune.Text          = item.ToString();
                    tune.TextAlignment = UITextAlignment.Center;
                });

                label.SetupStyle(ThemeConfig.ProductDetails.DetailsCell.Picker.PickerCell.Value);

                return(label);
            }
Example #6
0
        public virtual CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
        {
            var itemVm = GetItemAt(indexPath) as MultiCollectionItemVM;

            if (itemVm != null)
            {
                var label = new AppRopio.Base.iOS.Controls.ARLabel {
                    Frame = new CGRect(0, 0, 0, PDMultiSelectionTextCell.LABEL_HEIGHT), Text = itemVm.ValueName
                };

                label.SetupStyle(ThemeConfig.ProductDetails.DetailsCell.MultiSelection.MultiSelectionCell.Value);
                label.SizeToFit();

                return(new CGSize(label.Bounds.Width + PDMultiSelectionTextCell.HORIZONTAL_MARGINS, collectionView.Bounds.Height));
            }

            return(new CGSize(74, collectionView.Bounds.Height));
        }
        public virtual CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
        {
            var itemVm = GetItemAt(indexPath) as CollectionItemVM;

            if (itemVm != null)
            {
                if (itemVm.DataType == AppRopio.Models.Products.Responses.ProductDataType.Text)
                {
                    var label = new AppRopio.Base.iOS.Controls.ARLabel {
                        Text = itemVm.ValueName
                    };

                    label.SetupStyle(ThemeConfig.ProductDetails.DetailsCell.Collection.Value);
                    label.SizeToFit();

                    return(new CGSize(label.Bounds.Width + PDHorizontalTextCell.HORIZONTAL_MARGINS, collectionView.Bounds.Height));
                }
            }

            return(new CGSize(40, collectionView.Bounds.Height));
        }
        public virtual CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
        {
            var itemVm = GetItemAt(indexPath) as IAutocompleteItemVM;

            var itemSpacing = ((layout as UICollectionViewFlowLayout)?.MinimumInteritemSpacing ?? 0f) * 2f;
            var maxWidth    = (DeviceInfo.ScreenWidth - collectionView.ContentInset.Left - collectionView.ContentInset.Right - itemSpacing) / 2.0f;

            if (itemVm != null)
            {
                var label = new AppRopio.Base.iOS.Controls.ARLabel {
                    Text = itemVm.AutocompleteText
                };

                label.SetupStyle(ThemeConfig.ContentSearch.AutocompeleteCell.Title);
                label.SizeToFit();

                return(new CGSize(label.Bounds.Width + AutocompleteCell.HORIZONTAL_MARGINS, AutocompleteCell.CONTENT_HEIGHT));
            }

            return(new CGSize(52, collectionView.Bounds.Height));
        }
Example #9
0
 protected virtual void SetupName(AppRopio.Base.iOS.Controls.ARLabel name)
 {
     name.SetupStyle(ThemeConfig.ProductDetails.DetailsCell.Picker.Title ?? ThemeConfig.ProductDetails.DetailsCell.Title);
 }