What is a step size in a RatingBar? This is what I found in the documentation: The step size of this rating bar. For example, if half-star granularity is wanted, this would be 0.5. I tried to find it over here: https://developer.android.com/reference/android/widget/RatingBar.html. So can anyone explain it more simply so that I understand, please?
Asked
Active
Viewed 8,318 times
2 Answers
19
Its nothing but a factor by which you increase ratings on RatingBar. If you want ratings to be displayed like 3.5 or 4.5, you can use stepSize as 0.5. Incase, you want ratings like 3.1 or 4.3, you can have stepSize like 0.1.
Inshort,
stepSize = 1, Ratings = 0, 1, 2, 3, 4, 5, ...
stepSize = 0.1, Ratings = 0.0, 0.1, 0.2, ..., 1.0, ..., 2.0, ..., 5.0, ...
stepSize = 0.5, Ratings = 0.0, 0.5, 1.0, 1.5, 2.0, ..., 5.0, ...

Chintan Soni
- 24,761
- 25
- 106
- 174
-
So it is basically the area of the star which will be taken after polling. Did I get it right? – May 02 '17 at 11:00
-
Yes you are near :) – Chintan Soni May 02 '17 at 11:03
-
2it seems to me the lowest you can set is 0.5 which is also the default value. If you try to set lower than 0.5 it will use default. – Nulle Jul 31 '17 at 18:55
-3
This takes a float value which is the step size of rate increase/decrease. For example, if we set step size to 1.0 then the rating values will be increased/decreased by 1 the less the stepSize, the more presice the rating will be.
0.5 stepsize ------- 4.05,3.15,0.05 (ratings)
0.1 stepsize ------- 1.00,2.00,3.00 (ratings)
0.7 stepsize ------- 1.07,2.14,3.21 (ratings)

Gajendra Singh Rathore
- 73
- 10