Lines Matching refs:rating

25  * A class to encapsulate rating information used as content metadata.
26 * A rating is defined by its rating style (see {@link #RATING_HEART},
28 * {@link #RATING_5_STARS} or {@link #RATING_PERCENTAGE}) and the actual rating value (which may
29 * be defined as "unrated"), both of which are defined when the rating instance is constructed
36 * Indicates a rating style is not supported. A Rating will never have this
43 * A rating style with a single degree of rating, "heart" vs "no heart". Can be used to
49 * A rating style for "thumb up" vs "thumb down".
54 * A rating style with 0 to 3 stars.
59 * A rating style with 0 to 4 stars.
64 * A rating style with 0 to 5 stars.
69 * A rating style expressed as a percentage.
80 private RatingCompat(int ratingStyle, float rating) {
82 mRatingValue = rating;
87 return "Rating:style=" + mRatingStyle + " rating="
121 * Return a Rating instance with no rating.
122 * Create and return a new Rating instance with no rating known for the given
123 * rating style.
127 * @return null if an invalid rating style is passed, a new Rating instance otherwise.
144 * Return a Rating instance with a heart-based rating.
145 * Create and return a new Rating instance with a rating style of {@link #RATING_HEART},
146 * and a heart-based rating.
147 * @param hasHeart true for a "heart selected" rating, false for "heart unselected".
155 * Return a Rating instance with a thumb-based rating.
157 * rating style, and a "thumb up" or "thumb down" rating.
158 * @param thumbIsUp true for a "thumb up" rating, false for "thumb down".
166 * Return a Rating instance with a star-based rating.
167 * Create and return a new Rating instance with one of the star-base rating styles
169 * be used to represent an average rating value, which might not be an integer number of stars.
173 * the rating style.
174 * @return null if the rating style is invalid, or the rating is out of range,
190 Log.e(TAG, "Invalid rating style (" + starRatingStyle + ") for a star rating");
194 Log.e(TAG, "Trying to set out of range star-based rating");
201 * Return a Rating instance with a percentage-based rating.
203 * rating style, and a rating of the given percentage.
204 * @param percent the value of the rating
205 * @return null if the rating is out of range, a new Rating instance otherwise.
209 Log.e(TAG, "Invalid percentage-based rating value");
217 * Return whether there is a rating value available.
225 * Return the rating style.
235 * Return whether the rating is "heart selected".
236 * @return true if the rating is "heart selected", false if the rating is "heart unselected",
237 * if the rating style is not {@link #RATING_HEART} or if it is unrated.
248 * Return whether the rating is "thumb up".
249 * @return true if the rating is "thumb up", false if the rating is "thumb down",
250 * if the rating style is not {@link #RATING_THUMB_UP_DOWN} or if it is unrated.
261 * Return the star-based rating value.
262 * @return a rating value greater or equal to 0.0f, or a negative value if the rating style is
279 * Return the percentage-based rating value.
280 * @return a rating value greater or equal to 0.0f, or a negative value if the rating style is
306 final RatingCompat rating;
310 rating = newHeartRating(RatingCompatApi21.hasHeart(ratingObj));
313 rating = newThumbRating(RatingCompatApi21.isThumbUp(ratingObj));
318 rating = newStarRating(ratingStyle,
322 rating = newPercentageRating(RatingCompatApi21.getPercentRating(ratingObj));
328 rating = newUnratedRating(ratingStyle);
330 rating.mRatingObj = ratingObj;
331 return rating;