When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5 When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5 android android

When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5


You don't need star_half.

Try to do like this:

<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android">    <item android:id="@android:id/background" android:drawable="@drawable/star_none" />    <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/star_none" />    <item android:id="@android:id/progress" android:drawable="@drawable/star_fill" /></layer-list>