Skip to content

Commit

Permalink
[Housekeeping] Pending ImageButton CornerRadius changes (#5610)
Browse files Browse the repository at this point in the history
* Convert dp to px when setting ImageButton.CornerRadius

* Update ImageButtonExtensions.cs

Co-authored-by: Jimmy Reichley <jimmy.reichley@usssa.org>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
  • Loading branch information
3 people committed Mar 28, 2022
1 parent 1fa379e commit 8e3a691
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Core/src/Platform/Android/ImageButtonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ public static void UpdateStrokeThickness(this ShapeableImageView platformButton,

public static void UpdateCornerRadius(this ShapeableImageView platformButton, IButtonStroke buttonStroke)
{
var radius = platformButton.Context.ToPixels(buttonStroke.CornerRadius);
platformButton.ShapeAppearanceModel =
platformButton.ShapeAppearanceModel
.ToBuilder()
.SetTopLeftCorner(CornerFamily.Rounded, buttonStroke.CornerRadius)
.SetTopRightCorner(CornerFamily.Rounded, buttonStroke.CornerRadius)
.SetBottomLeftCorner(CornerFamily.Rounded, buttonStroke.CornerRadius)
.SetBottomRightCorner(CornerFamily.Rounded, buttonStroke.CornerRadius)
.SetTopLeftCorner(CornerFamily.Rounded, radius)
.SetTopRightCorner(CornerFamily.Rounded, radius)
.SetBottomLeftCorner(CornerFamily.Rounded, radius)
.SetBottomRightCorner(CornerFamily.Rounded, radius)
.Build();
}
}
}
}

0 comments on commit 8e3a691

Please sign in to comment.