StarRating
class StarRating : Rating
A rating expressed as a fractional number of stars.
Summary
Public constructors |
|---|
StarRating(maxStars: @IntRange(from = 1) Int)Creates a unrated instance with |
StarRating(Creates a rated instance with |
Public functions |
|
|---|---|
Boolean |
|
java-static StarRating! |
@UnstableApiRestores a |
Int |
hashCode() |
Boolean |
isRated()Whether the rating exists or not. |
Bundle! |
Returns a |
Inherited functions |
||
|---|---|---|
|
Public constructors
StarRating
StarRating(maxStars: @IntRange(from = 1) Int)
Creates a unrated instance with maxStars. If maxStars is not a positive integer, it will throw an IllegalArgumentException.
StarRating
StarRating(
maxStars: @IntRange(from = 1) Int,
starRating: @FloatRange(from = 0.0) Float
)
Creates a rated instance with maxStars and the given fractional number of stars. Non-integer values may be used to represent an average rating value. If maxStars is not a positive integer or starRating is out of range, it will throw an IllegalArgumentException.
| Parameters | |
|---|---|
maxStars: @IntRange(from = 1) Int |
The maximum number of stars this rating can have. |
starRating: @FloatRange(from = 0.0) Float |
A fractional number of stars of this rating from |
Public functions
fromBundle
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): StarRating!
Restores a StarRating from a Bundle.
toBundle
@UnstableApi
fun toBundle(): Bundle!
Returns a Bundle representing the information stored in this rating.