public final class HeartRating extends Rating


A rating expressed as "heart" or "no heart". It can be used to indicate whether the content is a favorite.

Summary

Public fields

final boolean

Public constructors

Creates a unrated instance.

HeartRating(boolean isHeart)

Creates a rated instance.

Public methods

boolean
static HeartRating

Restores a HeartRating from a Bundle.

int
boolean

Returns whether the rating is "heart".

boolean

Whether the rating exists or not.

Bundle

Returns a Bundle representing the information stored in this rating.

Inherited methods

From androidx.media3.common.Rating
static Rating

Restores a Rating from a Bundle.

Public fields

isHeart

public final boolean isHeart

Public constructors

HeartRating

public HeartRating()

Creates a unrated instance.

HeartRating

public HeartRating(boolean isHeart)

Creates a rated instance.

Parameters
boolean isHeart

true for "heart", false for "no heart".

Public methods

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static HeartRating fromBundle(Bundle bundle)

Restores a HeartRating from a Bundle.

hashCode

public int hashCode()

isHeart

public boolean isHeart()

Returns whether the rating is "heart".

isRated

public boolean isRated()

Whether the rating exists or not.

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this rating.