xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.59k stars 471 forks source link

[Spec] RatingView #273

Open dhindrik opened 4 years ago

dhindrik commented 4 years ago

RatingView

A rating view that shows stars. Could be used for showing reviews etc.

I wrote this blog post about how to create the control, https://danielhindrikes.se/index.php/2020/06/30/building-a-rating-control-using-xamarin-forms-shapes/. I think that is a good start but I will probably do some improvements to it when I implement it if this view is accepted.

API

RatingView

Properties

API Description
Rating The current value to show. Will redraw the stars and it is backed by a BindableProperty field
Max The number of stars to show. Will redraw the stars and it is backed by a BindableProperty field
FillColor The color to fill the stars with. Will redraw the stars and it is backed by a BindableProperty field
StrokeColor The color of strokes/border of the starts. Will redraw the stars and it is backed by a BindableProperty field
StorkeThickness The thickness of the stroke. Will redraw the stars and it is backed by a BindableProperty field
IsSelectionEnabled Enable or disable if users should be able to select a value. It is backed by a BindableProperty field

Events

API Description
RatingChanged If selection is enabled and the users tap a star this event will be fired.

Platform Compatibility

Difficulty : medium

jfversluis commented 4 years ago

On the other side, there is a bug for iOS so we can proberly not merge this until Xamarin.Forms 5.0 is released.

In that case, we're going to hold off for this until then. Also see #172. I'm not really liking the idea of adding stuff that is broken from day 1 and we know about it. That will only cause confusion and issues that will linger around maybe forever.

Also the experimental flags is a thing, I think it's a bad practice for a library to enable experimental flags on a users app. I like the idea of this control, but we either need to implement it differently or wait for Forms to catch up.

Didn't @jsuarezruiz also have something like this in one of his samples?

roubachof commented 4 years ago

https://github.com/jsuarezruiz/TemplateUI/wiki/Rate

angelru commented 4 years ago

rate is included in toolkit or TemplateUI?

jsuarezruiz commented 4 years ago

Rate is available in TemplateUI. It use Shapes API, so, we need to wait a little bit until increase the version used in the XCT. After that, I will be happy porting the control from TemplateUI to XCT and, @dhindrik will ping you to have your help.

Cfun1 commented 3 years ago

@jfversluis, @jsuarezruiz any update on this ?