Example #1
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 #4
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));
        }