ListBuilder.RangeBuilder
public
static
class
ListBuilder.RangeBuilder
extends Object
java.lang.Object | |
↳ | androidx.slice.builders.ListBuilder.RangeBuilder |
Builder to construct a range row which can be added to a ListBuilder
.
A range row supports displaying a horizontal progress indicator.
See also:
Summary
Public constructors | |
---|---|
RangeBuilder()
Builder to construct a range row which can be added to a |
Public methods | |
---|---|
ListBuilder.RangeBuilder
|
setContentDescription(CharSequence description)
Sets the content description. |
ListBuilder.RangeBuilder
|
setLayoutDirection(int layoutDirection)
Sets the desired layout direction for the content in this row. |
ListBuilder.RangeBuilder
|
setMax(int max)
Set the upper limit of the range. |
ListBuilder.RangeBuilder
|
setMode(int mode)
Sets the progress bar mode, it could be the determinate or indeterminate mode. |
ListBuilder.RangeBuilder
|
setPrimaryAction(SliceAction action)
Set the primary action for this row. |
ListBuilder.RangeBuilder
|
setSubtitle(CharSequence title)
Set the subtitle. |
ListBuilder.RangeBuilder
|
setTitle(CharSequence title)
Set the title. |
ListBuilder.RangeBuilder
|
setTitleItem(IconCompat icon, int imageMode, boolean isLoading)
Sets the title item to be the provided icon. |
ListBuilder.RangeBuilder
|
setTitleItem(IconCompat icon, int imageMode)
Sets the title item to be the provided icon. |
ListBuilder.RangeBuilder
|
setValue(int value)
Set the current value of the range. |
Inherited methods | |
---|---|
Public constructors
RangeBuilder
public RangeBuilder ()
Builder to construct a range row which can be added to a ListBuilder
.
A range row supports displaying a horizontal progress indicator. It supports two modes
to represent progress: determinate and indeterminate, see setMode(int)
.
Determinate mode is the default for progress indicator.
See also:
Public methods
setContentDescription
public ListBuilder.RangeBuilder setContentDescription (CharSequence description)
Sets the content description.
Parameters | |
---|---|
description |
CharSequence |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setLayoutDirection
public ListBuilder.RangeBuilder setLayoutDirection (int layoutDirection)
Sets the desired layout direction for the content in this row.
Parameters | |
---|---|
layoutDirection |
int : the layout direction to set.
|
Returns | |
---|---|
ListBuilder.RangeBuilder |
setMax
public ListBuilder.RangeBuilder setMax (int max)
Set the upper limit of the range. The default is 100.
Parameters | |
---|---|
max |
int |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setMode
public ListBuilder.RangeBuilder setMode (int mode)
Sets the progress bar mode, it could be the determinate or indeterminate mode.
Parameters | |
---|---|
mode |
int : the mode that progress bar should represent progress. |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setPrimaryAction
public ListBuilder.RangeBuilder 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.RangeBuilder |
setSubtitle
public ListBuilder.RangeBuilder setSubtitle (CharSequence title)
Set the subtitle.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setTitle
public ListBuilder.RangeBuilder setTitle (CharSequence title)
Set the title.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setTitleItem
public ListBuilder.RangeBuilder 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 using this method or its
overload setTitleItem(IconCompat, int)
.
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.RangeBuilder |
setTitleItem
public ListBuilder.RangeBuilder 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 using this method or its
overload setTitleItem(IconCompat, int, boolean)
.
Parameters | |
---|---|
icon |
IconCompat : the image to display. |
imageMode |
int : the mode that image should be displayed in. |
Returns | |
---|---|
ListBuilder.RangeBuilder |
setValue
public ListBuilder.RangeBuilder setValue (int value)
Set the current value of the range.
Parameters | |
---|---|
value |
int : the value of the range, between 0 and setMax(int) .
|
Returns | |
---|---|
ListBuilder.RangeBuilder |