I'am working on small sized golden yellow color ratingbar,which is to show some rating in float numbers like 4.2,3.75 etc.I have implemented the rating bar as below:-
<RatingBar
android:id="@+id/ratingBar1"
style="?android:attr/ratingBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"
android:theme="@style/RatingBar"
android:progressTint="@color/golden_yellow"
android:secondaryProgressTint="@color/golden_yellow"
/>
@style/RatingBar:-
<style name="RatingBar" parent="Theme.AppCompat">
<item name="colorControlNormal">@color/golden_yellow</item>
<item name="colorControlActivated">@color/golden_yellow</item>
<item name="ratingBarStyle">@style/Base.Widget.AppCompat.RatingBar.Small</item>
</style>
Now the problem is ,stars of rating bar is fully or half filled when giving the rating value as like 4.2 or 4.7 etc.I have given the stepsize as 0.1
ratingBar1.setStepSize((float) 0.1);
ratingBar1.setRating((float) 4);
I have given rating value as 4.2 but getting the output like this:
can someone help me to find the answer????