ListBuilder.InputRangeBuilder
public
static
class
ListBuilder.InputRangeBuilder
extends Object
java.lang.Object | |
↳ | androidx.slice.builders.ListBuilder.InputRangeBuilder |
Builder to construct a input range row.
An input range row supports displaying a horizontal slider allowing slider input.
Summary
Public constructors | |
---|---|
InputRangeBuilder()
Builder to construct a input range row. |
Public methods | |
---|---|
ListBuilder.InputRangeBuilder
|
addEndItem(SliceAction action, boolean isLoading)
Adds an action to the end items of the input range builder. |
ListBuilder.InputRangeBuilder
|
addEndItem(SliceAction action)
Adds an action to the end items of the input range builder. |
ListBuilder.InputRangeBuilder
|
setContentDescription(CharSequence description)
Sets the content description. |
ListBuilder.InputRangeBuilder
|
setInputAction(PendingIntent action)
Set the |
ListBuilder.InputRangeBuilder
|
setInputAction(RemoteCallback callback)
Set the |
ListBuilder.InputRangeBuilder
|
setLayoutDirection(int layoutDirection)
Sets the desired layout direction for the content in this row. |
ListBuilder.InputRangeBuilder
|
setMax(int max)
Set the upper limit of the range. |
ListBuilder.InputRangeBuilder
|
setMin(int min)
Set the lower limit of the range. |
ListBuilder.InputRangeBuilder
|
setPrimaryAction(SliceAction action)
Set the primary action for this row. |
ListBuilder.InputRangeBuilder
|
setSubtitle(CharSequence title)
Set the subtitle. |
ListBuilder.InputRangeBuilder
|
setThumb(IconCompat thumb)
Set the |
ListBuilder.InputRangeBuilder
|
setTitle(CharSequence title)
Set the title. |
ListBuilder.InputRangeBuilder
|
setTitleItem(IconCompat icon, int imageMode, boolean isLoading)
Sets the title item to be the provided icon. |
ListBuilder.InputRangeBuilder
|
setTitleItem(IconCompat icon, int imageMode)
Sets the title item to be the provided icon. |
ListBuilder.InputRangeBuilder
|
setValue(int value)
Set the current value of the range. |
Inherited methods | |
---|---|
Public constructors
InputRangeBuilder
public InputRangeBuilder ()
Builder to construct a input range row.
An input range row supports displaying a horizontal slider allowing slider input.
Public methods
addEndItem
public ListBuilder.InputRangeBuilder addEndItem (SliceAction action, boolean isLoading)
Adds an action to the end items of the input range builder. Only one non-custom toggle
can be added. If a non-custom toggle has already been added, this will throw
IllegalStateException
.
Use this method to specify content that will appear in the template once it's been loaded.
Parameters | |
---|---|
action |
SliceAction |
isLoading |
boolean : indicates whether the app is doing work to load the added content in the
background or not.
|
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
addEndItem
public ListBuilder.InputRangeBuilder addEndItem (SliceAction action)
Adds an action to the end items of the input range builder. Only one non-custom toggle
can be added. If a non-custom toggle has already been added, this will throw
IllegalStateException
.
Parameters | |
---|---|
action |
SliceAction |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setContentDescription
public ListBuilder.InputRangeBuilder setContentDescription (CharSequence description)
Sets the content description.
Parameters | |
---|---|
description |
CharSequence |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setInputAction
public ListBuilder.InputRangeBuilder setInputAction (PendingIntent action)
Set the PendingIntent
to send when the current value is updated.
Parameters | |
---|---|
action |
PendingIntent |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setInputAction
public ListBuilder.InputRangeBuilder setInputAction (RemoteCallback callback)
Set the PendingIntent
to send when the current value is updated.
Parameters | |
---|---|
callback |
RemoteCallback |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setLayoutDirection
public ListBuilder.InputRangeBuilder setLayoutDirection (int layoutDirection)
Sets the desired layout direction for the content in this row.
Parameters | |
---|---|
layoutDirection |
int : the layout direction to set.
|
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setMax
public ListBuilder.InputRangeBuilder setMax (int max)
Set the upper limit of the range. The default is 100.
Parameters | |
---|---|
max |
int |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setMin
public ListBuilder.InputRangeBuilder setMin (int min)
Set the lower limit of the range. The default is 0.
Parameters | |
---|---|
min |
int |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setPrimaryAction
public ListBuilder.InputRangeBuilder setPrimaryAction (SliceAction action)
Set the primary action for this row.
The action specified here will be sent when the whole row is clicked, whereas
the action specified via setInputAction(PendingIntent)
is used when the
slider is interacted with. Additionally, 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.InputRangeBuilder |
setSubtitle
public ListBuilder.InputRangeBuilder setSubtitle (CharSequence title)
Set the subtitle.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setThumb
public ListBuilder.InputRangeBuilder setThumb (IconCompat thumb)
Set the Icon
to be displayed as the thumb on the input range.
Parameters | |
---|---|
thumb |
IconCompat |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setTitle
public ListBuilder.InputRangeBuilder setTitle (CharSequence title)
Set the title.
Parameters | |
---|---|
title |
CharSequence |
Returns | |
---|---|
ListBuilder.InputRangeBuilder |
setTitleItem
public ListBuilder.InputRangeBuilder 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.InputRangeBuilder |
setTitleItem
public ListBuilder.InputRangeBuilder 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.InputRangeBuilder |
setValue
public ListBuilder.InputRangeBuilder setValue (int value)
Set the current value of the range.
Parameters | |
---|---|
value |
int : the value of the range, between setMin(int)
and setMax(int) .
|
Returns | |
---|---|
ListBuilder.InputRangeBuilder |