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.
Unfortunately, activation email could not send to your email. Please try again.

SfRating frequently renders the wrong value when set to Half precision

Thread ID:

Created:

Updated:

Platform:

Replies:

129290 Mar 9,2017 04:53 PM Mar 10,2017 07:09 AM Xamarin.Forms 1
loading
Tags: SfRating
Matthew Robbins
Asked On March 9, 2017 04:53 PM

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.


Rathana Kumar Sekar [Syncfusion]
Replied On March 10, 2017 07:09 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;