ListBuilder.RatingBuilder


class ListBuilder.RatingBuilder


Builder to construct a input star rating.

An star rating row supports displaying a horizontal tappable stars allowing rating input.

See also
addRating

Summary

Public constructors

Builder to construct a star rating row.

Public functions

ListBuilder.RatingBuilder

Sets the content description.

ListBuilder.RatingBuilder

Set the PendingIntent to send when the current value is updated.

ListBuilder.RatingBuilder

Set the PendingIntent to send when the current value is updated.

ListBuilder.RatingBuilder
setMax(max: Int)

Set the upper limit of the range.

ListBuilder.RatingBuilder
setMin(min: Int)

Set the lower limit of the range.

ListBuilder.RatingBuilder

Set the primary action for this row.

ListBuilder.RatingBuilder

Set the subtitle.

ListBuilder.RatingBuilder

Set the title.

ListBuilder.RatingBuilder
setTitleItem(icon: IconCompat, imageMode: Int)

Sets the title item to be the provided icon.

ListBuilder.RatingBuilder
setTitleItem(icon: IconCompat, imageMode: Int, isLoading: Boolean)

Sets the title item to be the provided icon.

ListBuilder.RatingBuilder
setValue(value: Float)

Set the current value of the range.

Public constructors

RatingBuilder

Added in 1.1.0-alpha02
RatingBuilder()

Builder to construct a star rating row.

An star rating row supports displaying a horizontal slider allowing slider input.

See also
addRating

Public functions

setContentDescription

Added in 1.1.0-alpha02
fun setContentDescription(description: CharSequence): ListBuilder.RatingBuilder

Sets the content description.

setInputAction

Added in 1.1.0-alpha02
fun setInputAction(action: PendingIntent): ListBuilder.RatingBuilder

Set the PendingIntent to send when the current value is updated.

setInputAction

Added in 1.1.0-alpha02
fun setInputAction(callback: RemoteCallback): ListBuilder.RatingBuilder

Set the PendingIntent to send when the current value is updated.

setMax

Added in 1.1.0-alpha02
fun setMax(max: Int): ListBuilder.RatingBuilder

Set the upper limit of the range. The default is 100.

setMin

Added in 1.1.0-alpha02
fun setMin(min: Int): ListBuilder.RatingBuilder

Set the lower limit of the range. The default is 0.

setPrimaryAction

Added in 1.1.0-alpha02
fun setPrimaryAction(action: SliceAction): ListBuilder.RatingBuilder

Set the primary action for this row.

The action specified here will be sent when the whole row is clicked. If this is the first row in a ListBuilder this action will also be used to define the MODE_SHORTCUT representation of the slice.

setSubtitle

Added in 1.1.0-alpha02
fun setSubtitle(title: CharSequence): ListBuilder.RatingBuilder

Set the subtitle.

setTitle

Added in 1.1.0-alpha02
fun setTitle(title: CharSequence): ListBuilder.RatingBuilder

Set the title.

setTitleItem

Added in 1.1.0-alpha02
fun setTitleItem(icon: IconCompat, imageMode: Int): ListBuilder.RatingBuilder

Sets the title item to be the provided icon. There can only be one title item, this will replace any other title items that may have been set.

Parameters
icon: IconCompat

the image to display.

imageMode: Int

the mode that image should be displayed in.

setTitleItem

Added in 1.1.0-alpha02
fun setTitleItem(icon: IconCompat, imageMode: Int, isLoading: Boolean): ListBuilder.RatingBuilder

Sets the title item to be the provided icon. There can only be one title item, this will replace any other title items that may have been set.

When set to true, the parameter isLoading indicates that the app is doing work to load this content in the background, in this case the template displays a placeholder until updated.

Parameters
icon: IconCompat

the image to display.

imageMode: Int

the mode that image should be displayed in.

isLoading: Boolean

whether this content is being loaded in the background.

setValue

Added in 1.1.0-alpha02
fun setValue(value: Float): ListBuilder.RatingBuilder

Set the current value of the range.

Parameters
value: Float

the value of the range, between setMin and setMax. Will be rounded to the nearest integer.