I have a requirement of round button, to show notification badge in my app.
I am currently doing it in a custom renderer, but unable to acheive. any help would be appreciated.
button.SizeChanged += (s, args) =>
{
var radius = (float)Math.Min(button.Width, button.Height);
// Create a drawable for the button's normal state
_normal = new Android.Graphics.Drawables.GradientDrawable();
if ((button.BackgroundColor.R.Equals(-1.0)) && (button.BackgroundColor.G.Equals(-1.0)) && (button.BackgroundColor.B.Equals(-1.0)))
_normal.SetColor(Android.Graphics.Color.ParseColor("#3A444D"));
else
_normal.SetColor(button.BackgroundColor.ToAndroid());
_normal.SetCornerRadius(radius);
// Create a drawable for the button's pressed state
_pressed = new GradientDrawable();
var highlight = Context.ObtainStyledAttributes(new int[] { Android.Resource.Attribute.ColorActivatedHighlight }).GetColor(0, Android.Graphics.Color.Gray);
_pressed.SetColor(highlight);
_pressed.SetCornerRadius(radius);
// Add the drawables to a state list and assign the state list to the button
var sld = new StateListDrawable();
sld.AddState(new int[] { Android.Resource.Attribute.StatePressed }, _pressed);
sld.AddState(new int[] { }, _normal);
Control.SetBackgroundDrawable(sld);
};