Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android RatingBar show black overlay on some devices

I have this ratingbar which is inside the applications and it is always displaying correctly. But recently I realise that it is not working correctly on some devices (which include Nexus 5 with Lollipop version). The rating bar are covered by a black overlay as shown on the image below (only on some devices). When listview (with rating stars) is scrolled, the rating bar will be shown (and then black overlay shows again). it only affect the yellow stars but not the white ones.

I am not sure if anyone had ever met this problem before? I am thinking if it is the recent android update on Nexus 5 that causes this as the rating bar works well on other devices.

Black overlay on rating star

like image 676
Lee Yi Hong Avatar asked Dec 15 '14 03:12

Lee Yi Hong


1 Answers

Accoring to me,

This may be using v21 of the support libraries or possibly unstable OS update as .xml file and code is not available.

These are the issue reported on google for rating bar please check link below,

RatingBar rendering broken on devices

The development team has fixed the issue that you have reported and it will be available in a future build.

RatingBar w/ Custom Stars Drawable is rendered as 1 stretched star on pre-Lollipop phones

when using v21 of the support libraries, the RatingBar w/ custom stars renders as expected. With v22, instead of 5 stars, you just get one, but stretched to match the width that 5 stars should take

First of all, do not use RatingBar#setProgressDrawable because no matter what platform, it is going to work like #setBackground() (single stretched image for whole background). Secondly, setting android:ratingBarStyle on theme level does not work. I ended up creating custom style, with "android:progressDrawable" and applying it for every view I needed.

RatingBar does not render in InfoWindow

setting the style to android:attr/ratingBarStyle does not work, and ratingBarStyleSmall does work

like image 163
Amit Vaghela Avatar answered Nov 09 '22 17:11

Amit Vaghela