예제 #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);
        }
예제 #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);
            }
        }
예제 #3
0
 protected object FindRenderer(string name)
 {
     return(FDroidUtils.FindRenderer(this, name));
 }
예제 #4
0
 protected TNativeView FindRenderer <TNativeView>(string name)
 {
     return(FDroidUtils.FindRenderer <TNativeView>(this, name));
 }