Package com.google.android.exoplayer2
Class StarRating
- java.lang.Object
-
- com.google.android.exoplayer2.Rating
-
- com.google.android.exoplayer2.StarRating
-
- All Implemented Interfaces:
Bundleable
@Deprecated public final class StarRating extends Rating
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.A rating expressed as a fractional number of stars.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<StarRating>CREATORDeprecated.Object that can restore aStarRatingfrom aBundle.
-
Constructor Summary
Constructors Constructor Description StarRating(int maxStars)Deprecated.Creates a unrated instance withmaxStars.StarRating(int maxStars, float starRating)Deprecated.Creates a rated instance withmaxStarsand the given fractional number of stars.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Deprecated.intgetMaxStars()Deprecated.Returns the maximum number of stars.floatgetStarRating()Deprecated.Returns the fractional number of stars of this rating.inthashCode()Deprecated.booleanisRated()Deprecated.Whether the rating exists or not.BundletoBundle()Deprecated.Returns aBundlerepresenting the information stored in this object.
-
-
-
Field Detail
-
CREATOR
public static final Bundleable.Creator<StarRating> CREATOR
Deprecated.Object that can restore aStarRatingfrom aBundle.
-
-
Constructor Detail
-
StarRating
public StarRating(@IntRange(from=1L) int maxStars)Deprecated.Creates a unrated instance withmaxStars. IfmaxStarsis not a positive integer, it will throw anIllegalArgumentException.- Parameters:
maxStars- The maximum number of stars this rating can have.
-
StarRating
public StarRating(@IntRange(from=1L) int maxStars, @FloatRange(from=0.0) float starRating)Deprecated.Creates a rated instance withmaxStarsand the given fractional number of stars. Non-integer values may be used to represent an average rating value. IfmaxStarsis not a positive integer orstarRatingis out of range, it will throw anIllegalArgumentException.- Parameters:
maxStars- The maximum number of stars this rating can have.starRating- A fractional number of stars of this rating from0ftomaxStars.
-
-
Method Detail
-
isRated
public boolean isRated()
Deprecated.Description copied from class:RatingWhether the rating exists or not.
-
getMaxStars
@IntRange(from=1L) public int getMaxStars()
Deprecated.Returns the maximum number of stars. Must be a positive number.
-
getStarRating
public float getStarRating()
Deprecated.Returns the fractional number of stars of this rating. Will range from0ftomaxStars, orRating.RATING_UNSETif unrated.
-
toBundle
public Bundle toBundle()
Deprecated.Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.
-
-