I stack with very annoing problem, I want to add custom drawable to my RatingBar widget, I followed some examples how to do it:
1) I created my own style, set minHeight=16dip
and maxHeight=16dip
2) Added 16px*16px star drawables.
It changed icon, but the problem is that my stars looks blur, i.e low resolution. And I know why, bcs drawables are 16*16px, but I cant make their qualitity better (for example 76px*76px), bcs Android won't scale a rating bar icons. When you decrease the minHeight and maxHeight android will always crop the icons. Even if I dont use min and max heght result is the same - my big drawables (I tried to add drawable in hdpi,xhdpi folders) just crop.
Is there a way how to increase resolution of my drawables in custom RatingBar? Thx.
P.S. here is my code just in case:
Style:
<style name="CustomRatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/rating_bar_drawable</item>
<item name="android:minHeight">16dip</item>
<item name="android:maxHeight">16dip</item>
</style>
rating_bar_drawable.xml:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background" android:drawable="@drawable/car_washes_star_empty" />
<item android:id="@android:id/secondaryProgress" android:drawable="@drawable/car_washes_star_fill" />
<item android:id="@android:id/progress" android:drawable="@drawable/car_washes_star_fill" />
main.xml:
<RatingBar
android:id="@+id/car_washes_list_item_rating_bar"
style="@style/CustomRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/car_washes_item_rating_bar_margin_right"
android:layout_marginRight="@dimen/car_washes_item_rating_bar_margin_right"
android:numStars="5"/>