ListBuilder.RatingBuilder
public
static
final
class
ListBuilder.RatingBuilder
extends Object
java.lang.Object | |
↳ | androidx.slice.builders.ListBuilder.RatingBuilder |
Builder to construct a input star rating.
An star rating row supports displaying a horizontal tappable stars allowing rating input.
See also:
Summary
Public constructors | |
---|---|
RatingBuilder()
Builder to construct a star rating row. |
Public methods | |
---|---|
ListBuilder.RatingBuilder
|
setContentDescription(CharSequence description)
Sets the content description. |
ListBuilder.RatingBuilder
|
setInputAction(RemoteCallback callback)
Set the |
ListBuilder.RatingBuilder
|
setInputAction(PendingIntent action)
Set the |
ListBuilder.RatingBuilder
|
setMax(int max)
Set the upper limit of the range. |
ListBuilder.RatingBuilder
|
setMin(int min)
Set the lower limit of the range. |
ListBuilder.RatingBuilder
|
setPrimaryAction(SliceAction action)
Set the primary action for this row. |
ListBuilder.RatingBuilder
|
setSubtitle(CharSequence title)
Set the subtitle. |
ListBuilder.RatingBuilder
|
setTitle(CharSequence title)
Set the title. |
ListBuilder.RatingBuilder
|
setTitleItem(IconCompat icon, int imageMode, boolean isLoading)
Sets the title item to be the provided icon. |
ListBuilder.RatingBuilder
|
setTitleItem(IconCompat icon, int imageMode)
Sets the title item to be the provided icon. |
ListBuilder.RatingBuilder
|
setValue(float value)
Set the current value of the range. |
Inherited methods | |
---|---|
Public constructors
RatingBuilder
public RatingBuilder ()
Builder to construct a star rating row.
An star rating row supports displaying a horizontal slider allowing slider input.
See also:
Public methods
setContentDescription
public ListBuilder.RatingBuilder setContentDescription (CharSequence description)
Sets the content description.
Parameters | |
---|---|
description |
CharSequence |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setInputAction
public ListBuilder.RatingBuilder setInputAction (RemoteCallback callback)
Set the PendingIntent
to send when the current value is updated.
Parameters | |
---|---|
callback |
RemoteCallback |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setInputAction
public ListBuilder.RatingBuilder setInputAction (PendingIntent action)
Set the PendingIntent
to send when the current value is updated.
Parameters | |
---|---|
action |
PendingIntent |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setMax
public ListBuilder.RatingBuilder setMax (int max)
Set the upper limit of the range. The default is 100.
Parameters | |
---|---|
max |
int |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setMin
public ListBuilder.RatingBuilder setMin (int min)
Set the lower limit of the range. The default is 0.
Parameters | |
---|---|
min |
int |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setPrimaryAction
public ListBuilder.RatingBuilder setPrimaryAction (SliceAction action)
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 SliceView.MODE_SHORTCUT
representation of the slice.
Parameters | |
---|---|
action |
SliceAction |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setSubtitle
public ListBuilder.RatingBuilder setSubtitle (CharSequence title)
Set the subtitle.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setTitle
public ListBuilder.RatingBuilder setTitle (CharSequence title)
Set the title.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setTitleItem
public ListBuilder.RatingBuilder setTitleItem (IconCompat icon, int imageMode, boolean isLoading)
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. |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setTitleItem
public ListBuilder.RatingBuilder setTitleItem (IconCompat icon, int imageMode)
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. |
Returns | |
---|---|
ListBuilder.RatingBuilder |
setValue
public ListBuilder.RatingBuilder setValue (float value)
Set the current value of the range.
Parameters | |
---|---|
value |
float : the value of the range, between setMin(int)
and setMax(int) . Will be rounded to the nearest integer.
|
Returns | |
---|---|
ListBuilder.RatingBuilder |