Fix star error
This commit is contained in:
1 parent
1d65db78f2
commit
b1cee421a5
2 files changed
+2
-2
No files matched your search
@@ -74,7 +74,7 @@ public class RatingView extends View {
|
||||
|
||||
private void updateShownCount() {
|
||||
float step = mMax / mStarCount / 2;
|
||||
int shown = Math.round(mRating / step);
|
||||
int shown = (int) Math.ceil(mRating / step);
|
||||
if (shown >= mStarCount * 2) {
|
||||
mShownStarCount = mStarCount;
|
||||
mShownStarHalfCount = 0;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class SimpleRatingView extends View {
|
||||
public void setRating(float rating) {
|
||||
if (mRating != rating) {
|
||||
mRating = rating;
|
||||
int ratingInt = Math.round(rating * 2);
|
||||
int ratingInt = (int) Math.ceil(rating * 2);
|
||||
if (mRatingInt != ratingInt) {
|
||||
mRatingInt = ratingInt;
|
||||
invalidate();
|
||||
|
||||
Reference in new issue
Block a user