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 |
setContentDescription(description: CharSequence)Sets the content description. |
ListBuilder.RatingBuilder |
setInputAction(action: PendingIntent)Set the |
ListBuilder.RatingBuilder |
setInputAction(callback: RemoteCallback)Set the |
ListBuilder.RatingBuilder |
Set the upper limit of the range. |
ListBuilder.RatingBuilder |
Set the lower limit of the range. |
ListBuilder.RatingBuilder |
setPrimaryAction(action: SliceAction)Set the primary action for this row. |
ListBuilder.RatingBuilder |
setSubtitle(title: CharSequence)Set the subtitle. |
ListBuilder.RatingBuilder |
setTitle(title: CharSequence)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 |
Set the current value of the range. |
Public constructors
RatingBuilder
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
fun setContentDescription(description: CharSequence): ListBuilder.RatingBuilder
Sets the content description.
setInputAction
fun setInputAction(action: PendingIntent): ListBuilder.RatingBuilder
Set the PendingIntent to send when the current value is updated.
setInputAction
fun setInputAction(callback: RemoteCallback): ListBuilder.RatingBuilder
Set the PendingIntent to send when the current value is updated.
setMax
fun setMax(max: Int): ListBuilder.RatingBuilder
Set the upper limit of the range. The default is 100.
setMin
fun setMin(min: Int): ListBuilder.RatingBuilder
Set the lower limit of the range. The default is 0.
setPrimaryAction
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
fun setSubtitle(title: CharSequence): ListBuilder.RatingBuilder
Set the subtitle.
setTitle
fun setTitle(title: CharSequence): ListBuilder.RatingBuilder
Set the title.
setTitleItem
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. |
| See also | |
|---|---|
ICON_IMAGE |
|
SMALL_IMAGE |
|
LARGE_IMAGE |
setTitleItem
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. |
| See also | |
|---|---|
ICON_IMAGE |
|
SMALL_IMAGE |
|
LARGE_IMAGE |
setValue
fun setValue(value: Float): ListBuilder.RatingBuilder
Set the current value of the range.