Lines Matching defs:rating

34  * A class to encapsulate rating information used as content metadata.
35 * A rating is defined by its rating style (see {@link #RATING_HEART},
37 * {@link #RATING_5_STARS} or {@link #RATING_PERCENTAGE}) and the actual rating value (which may
38 * be defined as "unrated"), both of which are defined when the rating instance is constructed
62 * Indicates a rating style is not supported. A Rating will never have this
69 * A rating style with a single degree of rating, "heart" vs "no heart". Can be used to
75 * A rating style for "thumb up" vs "thumb down".
80 * A rating style with 0 to 3 stars.
85 * A rating style with 0 to 4 stars.
90 * A rating style with 0 to 5 stars.
95 * A rating style expressed as a percentage.
106 RatingCompat(@Style int ratingStyle, float rating) {
108 mRatingValue = rating;
113 return "Rating:style=" + mRatingStyle + " rating="
147 * Return a Rating instance with no rating.
148 * Create and return a new Rating instance with no rating known for the given
149 * rating style.
153 * @return null if an invalid rating style is passed, a new Rating instance otherwise.
170 * Return a Rating instance with a heart-based rating.
171 * Create and return a new Rating instance with a rating style of {@link #RATING_HEART},
172 * and a heart-based rating.
173 * @param hasHeart true for a "heart selected" rating, false for "heart unselected".
181 * Return a Rating instance with a thumb-based rating.
183 * rating style, and a "thumb up" or "thumb down" rating.
184 * @param thumbIsUp true for a "thumb up" rating, false for "thumb down".
192 * Return a Rating instance with a star-based rating.
193 * Create and return a new Rating instance with one of the star-base rating styles
195 * be used to represent an average rating value, which might not be an integer number of stars.
199 * the rating style.
200 * @return null if the rating style is invalid, or the rating is out of range,
217 Log.e(TAG, "Invalid rating style (" + starRatingStyle + ") for a star rating");
221 Log.e(TAG, "Trying to set out of range star-based rating");
228 * Return a Rating instance with a percentage-based rating.
230 * rating style, and a rating of the given percentage.
231 * @param percent the value of the rating
232 * @return null if the rating is out of range, a new Rating instance otherwise.
236 Log.e(TAG, "Invalid percentage-based rating value");
244 * Return whether there is a rating value available.
252 * Return the rating style.
263 * Return whether the rating is "heart selected".
264 * @return true if the rating is "heart selected", false if the rating is "heart unselected",
265 * if the rating style is not {@link #RATING_HEART} or if it is unrated.
276 * Return whether the rating is "thumb up".
277 * @return true if the rating is "thumb up", false if the rating is "thumb down",
278 * if the rating style is not {@link #RATING_THUMB_UP_DOWN} or if it is unrated.
289 * Return the star-based rating value.
290 * @return a rating value greater or equal to 0.0f, or a negative value if the rating style is
308 * Return the percentage-based rating value.
309 * @return a rating value greater or equal to 0.0f, or a negative value if the rating style is
332 final RatingCompat rating;
336 rating = newHeartRating(((Rating) ratingObj).hasHeart());
339 rating = newThumbRating(((Rating) ratingObj).isThumbUp());
344 rating = newStarRating(ratingStyle,
348 rating = newPercentageRating(
355 rating = newUnratedRating(ratingStyle);
357 rating.mRatingObj = ratingObj;
358 return rating;