Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

HeartRating

class HeartRating : Rating
kotlin.Any
   ↳ androidx.media2.session.HeartRating

A class for rating with a single degree of rating, "heart" vs "no heart". This can be used to indicate the content referred to is a favorite (or not).

Summary

Public constructors

Creates a unrated HeartRating instance.

<init>(hasHeart: Boolean)

Creates a HeartRating instance.

Public methods

Boolean
equals(other: Any?)

Boolean

Returns whether the rating is "heart selected".

Int

Boolean

String

Public constructors

<init>

HeartRating()

Creates a unrated HeartRating instance.

<init>

HeartRating(hasHeart: Boolean)

Creates a HeartRating instance.

Parameters
hasHeart Boolean: true for a "heart selected" rating, false for "heart unselected".

Public methods

equals

fun equals(other: Any?): Boolean

hasHeart

fun hasHeart(): Boolean

Returns whether the rating is "heart selected".

Return
Boolean: true if the rating is "heart selected", false if the rating is "heart unselected", or if it is unrated.

hashCode

fun hashCode(): Int

isRated

fun isRated(): Boolean

toString

fun toString(): String