Esempio n. 1
0
 void SetLines(WLabel view)
 {
     if (view.Lines > -1)
     {
         this.Control.SetLines(view.Lines);
     }
 }
Esempio n. 2
0
 void SetLines(WLabel view)
 {
     if (view.Lines > -1)
     {
         Control.Lines = view.Lines;
     }
 }
Esempio n. 3
0
        void SetPadding(WLabel view)
        {
            var pxLeft   = FDroidUtils.Dp((int)view.Padding.Left);
            var pxTop    = FDroidUtils.Dp((int)view.Padding.Top);
            var pxRight  = FDroidUtils.Dp((int)view.Padding.Right);
            var pxBottom = FDroidUtils.Dp((int)view.Padding.Bottom);

            Control.SetPadding(pxLeft, pxTop, pxRight, pxBottom);
        }
Esempio n. 4
0
        void SetBorder(WLabel view)
        {
            if (view.BorderRadius > 0 || view.BorderWidth > 0)
            {
                // creating gradient drawable for the curved background
                var _gradientBackground = new GradientDrawable();
                _gradientBackground.SetShape(ShapeType.Rectangle);
                _gradientBackground.SetColor(view.BackgroundColor.ToAndroid());

                // Thickness of the stroke line
                _gradientBackground.SetStroke(FDroidUtils.Dp(view.BorderWidth), view.BorderColor.ToAndroid());

                // Radius for the curves
                _gradientBackground.SetCornerRadius(FDroidUtils.Dp(view.BorderRadius));

                // set the background of the label
                Control.SetBackgroundColor(Color.Transparent.ToAndroid());
                Control.SetBackground(_gradientBackground);
            }
        }
Esempio n. 5
0
        void SetBorder(WLabel view)
        {
            if (view.BorderRadius > 0)
            {
                Control.Layer.CornerRadius = view.BorderRadius;
                Control.ClipsToBounds      = true;
                Control.BackgroundColor    = view.BackgroundColor.ToUIColor();
                this.BackgroundColor       = UIColor.Clear;
            }

            if (view.BorderWidth > 0)
            {
                Control.Layer.BorderWidth = view.BorderWidth;
            }

            if (view.BorderColor != Color.Default)
            {
                Control.Layer.BorderColor = view.BorderColor.ToUIColor().CGColor;
            }
        }
Esempio n. 6
0
        void SetPadding(WLabel view)
        {
            var label = (WUILabel)Control;

            label.EdgeInsets = new UIEdgeInsets((nfloat)view.Padding.Top, (nfloat)view.Padding.Left, (nfloat)view.Padding.Bottom, (nfloat)view.Padding.Right);
        }