getProgress() should be using when using a Progressbar and getRating() when you use a Ratingbar.
The same applies to setProgress()
and setRating()
.
TL;DR
getProgress() is a class method Progressbar of which Ratingbar drift(extends) indirectly through Absseekbar.
The purpose of Progressbar is to visually indicate the partial "amount" that has already occurred from any processing.
A visual representation whose dimension is proportional to the elapsed "quantity" is used.
This dimension is calculated by relating the minimum and maximum value to the minimum and maximum size of the Progressbar.
By default these values are 0 and 100 and can be changed by the methods setMin()
and setMax()
.
The value of the "quantity" as a result of the process is assigned by setProgress()
and obtained by getProgress()
which, contrary to what it says, returns int.
The use of the values 0 and 100 provides that the "amount" elapsed is indicated as a percentage.
On the other hand, Ratingbar is used to represent a rating, using stars.
The number of stars to be displayed by Ratingbar is assigned by setNumStars()
.
Instead of an int, which is used to indicate the Progress, a float is used to indicate the ranting.
The use of a float, together with the indication of a step, allows the ranting is represented by the partial completion of the star.
So, contrary to what you say, the method getRating() returns float.
Note that the value returned by getRating()
may not be equal to the number of stars filled. This number depends on the maximum value for the rating, of step and the number of Ratingbar stars.
Despite the methods setProgress()
, getProgress()
and setMin()
are available should not be used when using Ratingbar.
This is a good example of a case where inheritance should not have been used.
"This is a good example of a case where no inheritance should have been used."!
– Andrei Coelho