public static void UpdateBackground(this MaterialButton platformView, IButton button) { var background = button.Background; if (background is SolidPaint) { platformView.UpdateBackground(background); } else { platformView.UpdateBorderDrawable(button); } }
public static void UpdateStrokeThickness(this MaterialButton platformView, IButton button) { if (platformView.Background is BorderDrawable) { platformView.UpdateBorderDrawable(button); return; } if (button is IButtonStroke buttonStroke && buttonStroke.StrokeThickness >= 0) { platformView.StrokeWidth = (int)platformView.Context.ToPixels(buttonStroke.StrokeThickness); } }
public static void UpdateCornerRadius(this MaterialButton platformView, IButton button) { if (platformView.Background is BorderDrawable) { platformView.UpdateBorderDrawable(button); return; } if (button is IButtonStroke buttonStroke && buttonStroke.CornerRadius >= 0) { platformView.CornerRadius = (int)platformView.Context.ToPixels(buttonStroke.CornerRadius); } }
public static void UpdateStrokeColor(this MaterialButton platformView, IButton button) { if (platformView.Background is BorderDrawable) { platformView.UpdateBorderDrawable(button); return; } if (button is IButtonStroke buttonStroke && buttonStroke.StrokeColor is Color stroke) { platformView.StrokeColor = ColorStateListExtensions.CreateButton(stroke.ToPlatform()); } }