The default color of AndroidBar star color is blue, like this:
I want to change the color into green. I've tried several ways, none of them works.
Using android:progressTint
<RatingBar
android:id="@+id/rb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="false"
style="?android:attr/ratingBarStyleSmall"
android:numStars="5"
android:stepSize="1"
android:progressTint="@color/green"
android:layout_gravity="center"/>
Another attempt. Put a new style in styles.xml:
<style name="RatingBar" parent="Theme.AppCompat">
<item name="colorControlNormal">@color/iron</item>
<item name="colorControlActivated">@color/green</item>
</style>
And apply it:
<RatingBar
android:id="@+id/rb"
android:theme="@style/RatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="false"
style="?android:attr/ratingBarStyleSmall"
android:numStars="5"
android:stepSize="1"
android:layout_gravity="center"/>
My test device is an ASUS phone, running Android 4.4.2. Is there another way, which works on Android 4 and newer? Thank you.