Esempio n. 1
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. 2
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);
            }
        }