-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Enhancement] Shapes #9218
[Enhancement] Shapes #9218
Conversation
I note that the implementation creates a pile of new renderers. How about instead creating a |
@jsuarezruiz Will it be possible to animate the drawing of such shapes? for example, animating drawing a circle or whatsoever. that would be huge in my opinion. |
Will this support gradients and images for background and borders? |
@bcaceiro Yes, it will be possible to apply animations or transformations to Shapes. |
Implemented basic Shapes on iOS
It's 5MB. Maybe you are not using aab. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only reviewed the Core API. it's strange to have some APIs taking start end, and other shapes taking the full space of the view (to be consistent, Line should draw a line from top-left to bottom-right, or all shapes should have positioning and sizing inside of their bounding boxes).
I'm ok to 👍 this as it's behind an experimental flag, but it needs to be addressed at some point.
{ | ||
public Ellipse() | ||
{ | ||
Aspect = Stretch.Fill; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're not setting a default property here, but a strongly set one, preventing styling. Use defaultValueCreator for that
public static readonly BindableProperty X2Property = | ||
BindableProperty.Create(nameof(X2), typeof(double), typeof(Line), 0.0d); | ||
|
||
public static readonly BindableProperty Y2Property = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's quite inconsistent to have Line defined with 2 points, and other shapes with width and height
{ | ||
public override object ConvertFromInvariantString(string value) | ||
{ | ||
string[] points = value.Split(new char[] { ' ', ',' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we so far only use ',' as list separator in xaml
namespace Xamarin.Forms.Shapes | ||
{ | ||
[RenderWith(typeof(_RectangleRenderer))] | ||
public sealed class Rectangle : Shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the file
public static readonly BindableProperty RadiusYProperty = | ||
BindableProperty.Create(nameof(RadiusY), typeof(double), typeof(Rectangle), 0.0d); | ||
|
||
public double RadiusX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't have CornerRadius instead of RX, RY ?
Description of Change
Shapes support is added:
Issues Resolved
API Changes
Added:
Ellipse
Rectangle
Polygon
Line
Polyline
Also added:
Platforms Affected
Behavioral/Visual Changes
None
Screenshots
Testing Procedure
Launch Core Gallery and navigate to the new Shapes Gallery.
Notes
PR Checklist