Closed timshinlee closed 7 years ago
Hi, @timshinlee. Sorry for the late response.
If you mean the number of stars, you can change it with app:srb_numberOfStars / setNumberOfStars(int)
@FlyingPumba It doesn't matter. Glad to get your response! I mean the max score to determine how many stars to fill in. It seems the max score is always 5. For example, will I be able to call setRating(5f) in the base of 10, then two and a half stars are filled in instead of all?
@timshinlee Currently there is no method to change the max rating. It's assumed that the max rating is the number of stars. I might add it in the next version (something like setMax in Android's official RatingBar).
Until then, you can of course use rule of Three to convert from one range to the other:
void setRatingBase10(SimpleRatingBar srb, float ratingBase10) {
srb.setRating(ratingBase10 / 10f * 5f);
}
float getRatingBase10(SimpleRatingBar srb) {
return srb.getRating() / 5f * 10f;
}
@FlyingPumba Cool! I will follow your suggestion. Thanks for your kindly help! Hope this won't bother you.
I love this simple but powerful widget. But I don't know how to change the max rating. Thanks A lot!