We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfRating frequently renders the wrong value when set to Half precision

Associated Repository: https://github.com/matthewrdev/syncfusion-star-rating-bug

## Description
When using the `SfRating` control to display a star rating value set to half-precision, the Android version of the control frequently displays values incorrectly.

**Key Files:**
 - [StarRatingBugPage.xaml](StarRatingBug/StarRatingBugPage.xaml): The UI for this app. Here we are data-binding an integer value of 0-10 to the star rating control, dividing it by 2 using a value converter and then using the `SfRating` control to display that value at `Half` precision (EG: 0, 0.5, 1, 1.5 etc through to 5).

**Sample Xaml:**
 ```
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:local="clr-namespace:StarRatingBug"
xmlns:sf="clr-namespace:Syncfusion.SfRating.XForms;assembly=Syncfusion.SfRating.XForms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="StarRatingBug.StarRatingBugPage">
<ContentPage.Resources>
<ResourceDictionary>
<local:HalfIntConverter x:Key="halfIntConverter"/>
<local:ValueToMessageConverter x:Key="valueToMessageConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout Padding="0,20,0,0">
<sf:SfRating Precision="Half" Value="{Binding Value, Converter={StaticResource halfIntConverter}}">
<sf:SfRating.RatingSettings>
<sf:SfRatingSettings RatedFill="#F6FF00"
UnRatedFill="White"
UnRatedStroke="Black"
UnRatedStrokeWidth="1">
</sf:SfRatingSettings>
</sf:SfRating.RatingSettings>
</sf:SfRating>
<Button HorizontalOptions="Center"
Text="Tap for random int value from 0 to 10"
VerticalOptions="Center"
   Command="{Binding RandomNumberCommand}"/>
<Label Text="{Binding Value, Converter={StaticResource valueToMessageConverter}, Mode=OneWay}"/>
</StackLayout>
</ContentPage>
 ```

## Steps To Reproduce
 1. Clone the following repository: https://github.com/matthewrdev/syncfusion-star-rating-bug
 2. Open StarRatingBug.sln in Xamarin Studio for Mac.
 3. Build the project.
 4. **IMPORTANT: Run project on an ANDROID emulator/device**
 5. Repeatedly tap the button titled `TAP FOR RANDOM INT VALUE FROM 0 TO 10`.
 6. Observe that the text saying the expected rating and the star rating are matching.
 7. Eventually, the star rating control will display a value half a value out or sync.


## Expected Result
The star rating control correctly displays decimal values at half-precision.

## Actual Result
The star rating control frequently displays an incorrect half-precision value.


1 Reply

RK Rathana Kumar Sekar Syncfusion Team March 10, 2017 12:09 PM UTC

Hi Matthew,

Thanks for contacting Syncfusion Support.

We could reproduce the reported issue "SfRating frequently renders the wrong value when set to half precision" from our side and fix for the reported issue will be available in our upcoming Volume 2 release which will be available by the mid of the April.

Please let us if you have any other queries.

Regards,
Rathanakumar S.

Loader.
Up arrow icon