java.lang.Object | |
↳ | android.media.Rating |
A class to encapsulate rating information used as content metadata.
A rating is defined by its rating style (see RATING_HEART
,
RATING_THUMB_UP_DOWN
, RATING_3_STARS
, RATING_4_STARS
,
RATING_5_STARS
or RATING_PERCENTAGE
) and the actual rating value (which may
be defined as "unrated"), both of which are defined when the rating instance is constructed
through one of the factory methods.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RATING_3_STARS | A rating style with 0 to 3 stars. | |||||||||
int | RATING_4_STARS | A rating style with 0 to 4 stars. | |||||||||
int | RATING_5_STARS | A rating style with 0 to 5 stars. | |||||||||
int | RATING_HEART | A rating style with a single degree of rating, "heart" vs "no heart". | |||||||||
int | RATING_NONE | Indicates a rating style is not supported. | |||||||||
int | RATING_PERCENTAGE | A rating style expressed as a percentage. | |||||||||
int | RATING_THUMB_UP_DOWN | A rating style for "thumb up" vs "thumb down". |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Return the percentage-based rating value.
| |||||||||||
Return the rating style.
| |||||||||||
Return the star-based rating value.
| |||||||||||
Return whether the rating is "heart selected".
| |||||||||||
Return whether there is a rating value available.
| |||||||||||
Return whether the rating is "thumb up".
| |||||||||||
Return a Rating instance with a heart-based rating.
| |||||||||||
Return a Rating instance with a percentage-based rating.
| |||||||||||
Return a Rating instance with a star-based rating.
| |||||||||||
Return a Rating instance with a thumb-based rating.
| |||||||||||
Return a Rating instance with no rating.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
A rating style with 0 to 3 stars.
A rating style with 0 to 4 stars.
A rating style with 0 to 5 stars.
A rating style with a single degree of rating, "heart" vs "no heart". Can be used to indicate the content referred to is a favorite (or not).
Indicates a rating style is not supported. A Rating will never have this type, but can be used by other classes to indicate they do not support Rating.
A rating style expressed as a percentage.
A rating style for "thumb up" vs "thumb down".
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Return the percentage-based rating value.
Return the star-based rating value.
Return whether the rating is "heart selected".
RATING_HEART
or if it is unrated.
Return whether there is a rating value available.
newUnratedRating(int)
.
Return whether the rating is "thumb up".
RATING_THUMB_UP_DOWN
or if it is unrated.
Return a Rating instance with a heart-based rating.
Create and return a new Rating instance with a rating style of RATING_HEART
,
and a heart-based rating.
hasHeart | true for a "heart selected" rating, false for "heart unselected". |
---|
Return a Rating instance with a percentage-based rating.
Create and return a new Rating instance with a RATING_PERCENTAGE
rating style, and a rating of the given percentage.
percent | the value of the rating |
---|
Return a Rating instance with a star-based rating. Create and return a new Rating instance with one of the star-base rating styles and the given integer or fractional number of stars. Non integer values can for instance be used to represent an average rating value, which might not be an integer number of stars.
starRatingStyle | one of RATING_3_STARS , RATING_4_STARS ,
RATING_5_STARS . |
---|---|
starRating | a number ranging from 0.0f to 3.0f, 4.0f or 5.0f according to the rating style. |
Return a Rating instance with a thumb-based rating.
Create and return a new Rating instance with a RATING_THUMB_UP_DOWN
rating style, and a "thumb up" or "thumb down" rating.
thumbIsUp | true for a "thumb up" rating, false for "thumb down". |
---|
Return a Rating instance with no rating. Create and return a new Rating instance with no rating known for the given rating style.
ratingStyle | one of RATING_HEART , RATING_THUMB_UP_DOWN ,
RATING_3_STARS , RATING_4_STARS , RATING_5_STARS ,
or RATING_PERCENTAGE . |
---|
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|