ListBuilder.RatingBuilder

public final 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 methods

@NonNull ListBuilder.RatingBuilder

Sets the content description.

@NonNull ListBuilder.RatingBuilder

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

@NonNull ListBuilder.RatingBuilder

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

@NonNull ListBuilder.RatingBuilder
setMax(int max)

Set the upper limit of the range.

@NonNull ListBuilder.RatingBuilder
setMin(int min)

Set the lower limit of the range.

@NonNull ListBuilder.RatingBuilder

Set the primary action for this row.

@NonNull ListBuilder.RatingBuilder

Set the subtitle.

@NonNull ListBuilder.RatingBuilder

Set the title.

@NonNull ListBuilder.RatingBuilder
setTitleItem(@NonNull IconCompat icon, int imageMode)

Sets the title item to be the provided icon.

@NonNull ListBuilder.RatingBuilder
setTitleItem(@NonNull IconCompat icon, int imageMode, boolean isLoading)

Sets the title item to be the provided icon.

@NonNull ListBuilder.RatingBuilder
setValue(float value)

Set the current value of the range.

Public constructors

RatingBuilder

Added in 1.1.0-alpha02
public RatingBuilder()

Builder to construct a star rating row.

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

See also
addRating

Public methods

setContentDescription

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setContentDescription(@NonNull CharSequence description)

Sets the content description.

setInputAction

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setInputAction(@NonNull PendingIntent action)

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

setInputAction

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setInputAction(@NonNull RemoteCallback callback)

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

setMax

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setMax(int max)

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

setMin

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setMin(int min)

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

setPrimaryAction

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setPrimaryAction(@NonNull 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 MODE_SHORTCUT representation of the slice.

setSubtitle

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setSubtitle(@NonNull CharSequence title)

Set the subtitle.

setTitle

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setTitle(@NonNull CharSequence title)

Set the title.

setTitleItem

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setTitleItem(@NonNull 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
@NonNull IconCompat icon

the image to display.

int imageMode

the mode that image should be displayed in.

setTitleItem

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setTitleItem(@NonNull 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
@NonNull IconCompat icon

the image to display.

int imageMode

the mode that image should be displayed in.

boolean isLoading

whether this content is being loaded in the background.

setValue

Added in 1.1.0-alpha02
public @NonNull ListBuilder.RatingBuilder setValue(float value)

Set the current value of the range.

Parameters
float value

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