using Android.Content;
using Android.Graphics.Drawables;
using ProjectName.Droid.Renderers;
using Syncfusion.XForms.Android.MaskedEdit;
using Syncfusion.XForms.MaskedEdit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(SfMaskedEdit), typeof(CustomSFMaskedEditRenderer))]
namespace ProjectName.Droid.Renderers
{
public class CustomSFMaskedEditRenderer : SfMaskedEditRenderer
{
public CustomSFMaskedEditRenderer() : base(){}
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (e.OldElement != null) return;
UpdateEntryStyle();
}
void UpdateEntryStyle()
{
var shape = new GradientDrawable();
shape.SetShape(ShapeType.Rectangle);
shape.SetCornerRadius(5);
shape.SetStroke(3, Android.Graphics.Color.LightGray);
shape.SetColor(Android.Graphics.Color.White);
this.Control.SetBackground(shape);
this.Control.SetPadding(8, 15, 8, 0);
}
}
}