public final class

ListBuilder.RatingBuilder

extends java.lang.Object

 java.lang.Object

↳androidx.slice.builders.ListBuilder.RatingBuilder

Overview

Builder to construct a input star rating.

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

Summary

Fields
public static final intTYPE_ACTION

Constructors
publicRatingBuilder()

Builder to construct a star rating row.

Methods
public PendingIntentgetAction()

public java.lang.CharSequencegetContentDescription()

public PendingIntentgetInputAction()

public intgetMax()

public intgetMin()

public SliceActiongetPrimaryAction()

public java.lang.CharSequencegetSubtitle()

public java.lang.CharSequencegetTitle()

public IconCompatgetTitleIcon()

public intgetTitleImageMode()

public floatgetValue()

public booleanisTitleItemLoading()

public booleanisValueSet()

public ListBuilder.RatingBuildersetContentDescription(java.lang.CharSequence description)

Sets the content description.

public ListBuilder.RatingBuildersetInputAction(PendingIntent action)

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

public ListBuilder.RatingBuildersetMax(int max)

Set the upper limit of the range.

public ListBuilder.RatingBuildersetMin(int min)

Set the lower limit of the range.

public ListBuilder.RatingBuildersetPrimaryAction(SliceAction action)

Set the primary action for this row.

public ListBuilder.RatingBuildersetSubtitle(java.lang.CharSequence title)

Set the subtitle.

public ListBuilder.RatingBuildersetTitle(java.lang.CharSequence title)

Set the title.

public ListBuilder.RatingBuildersetTitleItem(IconCompat icon, int imageMode)

Sets the title item to be the provided icon.

public ListBuilder.RatingBuildersetTitleItem(IconCompat icon, int imageMode, boolean isLoading)

Sets the title item to be the provided icon.

public ListBuilder.RatingBuildersetValue(float value)

Set the current value of the range.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int TYPE_ACTION

Constructors

public RatingBuilder()

Builder to construct a star rating row.

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

See also: ListBuilder.addRating(ListBuilder.RatingBuilder)

Methods

public int getMin()

public ListBuilder.RatingBuilder setMin(int min)

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

public int getMax()

public ListBuilder.RatingBuilder setMax(int max)

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

public float getValue()

public ListBuilder.RatingBuilder setValue(float value)

Set the current value of the range.

Parameters:

value: the value of the range, between ListBuilder.RatingBuilder.setMin(int) and ListBuilder.RatingBuilder.setMax(int). Will be rounded to the nearest integer.

public boolean isValueSet()

public PendingIntent getAction()

public java.lang.CharSequence getContentDescription()

public ListBuilder.RatingBuilder setTitle(java.lang.CharSequence title)

Set the title.

public ListBuilder.RatingBuilder setSubtitle(java.lang.CharSequence title)

Set the subtitle.

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.

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: the image to display.
imageMode: the mode that image should be displayed in.

See also: ListBuilder.ICON_IMAGE, ListBuilder.SMALL_IMAGE, ListBuilder.LARGE_IMAGE

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: the image to display.
imageMode: the mode that image should be displayed in.
isLoading: whether this content is being loaded in the background.

See also: ListBuilder.ICON_IMAGE, ListBuilder.SMALL_IMAGE, ListBuilder.LARGE_IMAGE

public ListBuilder.RatingBuilder setContentDescription(java.lang.CharSequence description)

Sets the content description.

public PendingIntent getInputAction()

public ListBuilder.RatingBuilder setInputAction(PendingIntent action)

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

public java.lang.CharSequence getTitle()

public java.lang.CharSequence getSubtitle()

public SliceAction getPrimaryAction()

public boolean isTitleItemLoading()

public int getTitleImageMode()

public IconCompat getTitleIcon()