# RatingCompat

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:android/support/v4/media/RatingCompat.java+class:android.support.v4.media.RatingCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
class RatingCompat : Parcelable
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

A class to encapsulate rating information used as content metadata. A rating is defined by its rating style (see `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_3_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_4_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_5_STARS()` or `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#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.

## Summary

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/android/os/Parcelable.Creator.html<https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!>!` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#CREATOR()` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_3_STARS() = 3` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_4_STARS() = 4` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_5_STARS() = 5` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART() = 1` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_NONE() = 0` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_PERCENTAGE() = 6` **This property is deprecated.** Deprecated in Java |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN() = 2` **This property is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[describeContents](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#describeContents())()` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[fromRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#fromRating(java.lang.Object))(ratingObj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `[getPercentRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getPercentRating())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | `[getRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getRating())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getRatingStyle](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getRatingStyle())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `[getStarRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getStarRating())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[hasHeart](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#hasHeart())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[isRated](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#isRated())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[isThumbUp](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#isThumbUp())()` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[newHeartRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newHeartRating(boolean))(hasHeart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[newPercentageRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newPercentageRating(float))(percent: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[newStarRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newStarRating(int,float))(starRatingStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, starRating: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[newThumbRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newThumbRating(boolean))(thumbIsUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |
| `java-static https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | `[newUnratedRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newUnratedRating(int))(ratingStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `[toString](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#toString())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[writeToParcel](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#writeToParcel(android.os.Parcel,int))(dest: https://developer.android.com/reference/android/os/Parcel.html!, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |

### Inherited Constants

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1`

**This property is deprecated.** Deprecated in Java
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

**This property is deprecated.** Deprecated in Java

## Constants

### CREATOR

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val CREATOR: Parcelable.Creator<RatingCompat!>!
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

### RATING_3_STARS

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_3_STARS = 3: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

A rating style with 0 to 3 stars.

### RATING_4_STARS

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_4_STARS = 4: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

A rating style with 0 to 4 stars.

### RATING_5_STARS

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_5_STARS = 5: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

A rating style with 0 to 5 stars.

### RATING_HEART

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_HEART = 1: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

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).

### RATING_NONE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_NONE = 0: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

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.

### RATING_PERCENTAGE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_PERCENTAGE = 6: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

A rating style expressed as a percentage.

### RATING_THUMB_UP_DOWN

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val RATING_THUMB_UP_DOWN = 2: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

A rating style for "thumb up" vs "thumb down".

## Public functions

### describeContents

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [describeContents](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#describeContents())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

### fromRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [fromRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#fromRating(java.lang.Object))(ratingObj: Any!): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Creates an instance from a framework `https://developer.android.com/reference/android/media/Rating.html` object.

This method is only supported on API 19+.

| Parameters |
|---|---|
| `ratingObj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | A `https://developer.android.com/reference/android/media/Rating.html` object, or null if none. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | An equivalent `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat` object, or null if none. |

### getPercentRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getPercentRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getPercentRating())(): Float
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return the percentage-based rating value.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | a rating value greater or equal to 0.0f, or a negative value if the rating style is not percentage-based, or if it is unrated. |

### getRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getRating())(): Any!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Gets the underlying framework `https://developer.android.com/reference/android/media/Rating.html` object.

This method is only supported on API 19+.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | An equivalent `https://developer.android.com/reference/android/media/Rating.html` object, or null if none. |

### getRatingStyle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getRatingStyle](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getRatingStyle())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return the rating style.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_3_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_4_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_5_STARS()`, or `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_PERCENTAGE()`. |

### getStarRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getStarRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#getStarRating())(): Float
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return the star-based rating value.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | a rating value greater or equal to 0.0f, or a negative value if the rating style is not star-based, or if it is unrated. |

### hasHeart

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [hasHeart](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#hasHeart())(): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return whether the rating is "heart selected".

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the rating is "heart selected", false if the rating is "heart unselected", if the rating style is not `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART()` or if it is unrated. |

### isRated

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [isRated](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#isRated())(): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return whether there is a rating value available.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the instance was not created with `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newUnratedRating(int)`. |

### isThumbUp

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [isThumbUp](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#isThumbUp())(): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return whether the rating is "thumb up".

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the rating is "thumb up", false if the rating is "thumb down", if the rating style is not `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN()` or if it is unrated. |

### newHeartRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [newHeartRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newHeartRating(boolean))(hasHeart: Boolean): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return a Rating instance with a heart-based rating. Create and return a new Rating instance with a rating style of `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART()`, and a heart-based rating.

| Parameters |
|---|---|
| `hasHeart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true for a "heart selected" rating, false for "heart unselected". |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | a new Rating instance. |

### newPercentageRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [newPercentageRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newPercentageRating(float))(percent: Float): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return a Rating instance with a percentage-based rating. Create and return a new Rating instance with a `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_PERCENTAGE()` rating style, and a rating of the given percentage.

| Parameters |
|---|---|
| `percent: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the value of the rating |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | null if the rating is out of range, a new Rating instance otherwise. |

### newStarRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [newStarRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newStarRating(int,float))(starRatingStyle: Int, starRating: Float): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

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.

| Parameters |
|---|---|
| `starRatingStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_3_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_4_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_5_STARS()`. |
| `starRating: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | a number ranging from 0.0f to 3.0f, 4.0f or 5.0f according to the rating style. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | null if the rating style is invalid, or the rating is out of range, a new Rating instance otherwise. |

### newThumbRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [newThumbRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newThumbRating(boolean))(thumbIsUp: Boolean): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return a Rating instance with a thumb-based rating. Create and return a new Rating instance with a `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN()` rating style, and a "thumb up" or "thumb down" rating.

| Parameters |
|---|---|
| `thumbIsUp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true for a "thumb up" rating, false for "thumb down". |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | a new Rating instance. |

### newUnratedRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
java-static fun [newUnratedRating](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#newUnratedRating(int))(ratingStyle: Int): RatingCompat!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return a Rating instance with no rating. Create and return a new Rating instance with no rating known for the given rating style.

| Parameters |
|---|---|
| `ratingStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_HEART()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_THUMB_UP_DOWN()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_3_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_4_STARS()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_5_STARS()`, or `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#RATING_PERCENTAGE()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | null if an invalid rating style is passed, a new Rating instance otherwise. |

### toString

```
fun [toString](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#toString())(): String!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

### writeToParcel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [writeToParcel](https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat#writeToParcel(android.os.Parcel,int))(dest: Parcel!, flags: Int): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java