ListBuilder.InputRangeBuilder
public class ListBuilder.InputRangeBuilder
InputRangeBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
Builder to construct a input range row.
An input range row supports displaying a horizontal slider allowing slider input.
| See also | |
|---|---|
addInputRange |
Summary
Public constructors |
|---|
|
Builder to construct a input range row. |
Public methods |
|
|---|---|
@NonNull ListBuilder.InputRangeBuilder |
addEndItem(@NonNull SliceAction action)Adds an action to the end items of the input range builder. |
@NonNull ListBuilder.InputRangeBuilder |
addEndItem(@NonNull SliceAction action, boolean isLoading)Adds an action to the end items of the input range builder. |
@NonNull ListBuilder.InputRangeBuilder |
setContentDescription(@NonNull CharSequence description)Sets the content description. |
@NonNull ListBuilder.InputRangeBuilder |
setInputAction(@NonNull PendingIntent action)Set the |
@NonNull ListBuilder.InputRangeBuilder |
setInputAction(@NonNull RemoteCallback callback)Set the |
@NonNull ListBuilder.InputRangeBuilder |
setLayoutDirection(int layoutDirection)Sets the desired layout direction for the content in this row. |
@NonNull ListBuilder.InputRangeBuilder |
setMax(int max)Set the upper limit of the range. |
@NonNull ListBuilder.InputRangeBuilder |
setMin(int min)Set the lower limit of the range. |
@NonNull ListBuilder.InputRangeBuilder |
setPrimaryAction(@NonNull SliceAction action)Set the primary action for this row. |
@NonNull ListBuilder.InputRangeBuilder |
setSubtitle(@NonNull CharSequence title)Set the subtitle. |
@NonNull ListBuilder.InputRangeBuilder |
setThumb(@NonNull IconCompat thumb)Set the |
@NonNull ListBuilder.InputRangeBuilder |
setTitle(@NonNull CharSequence title)Set the title. |
@NonNull ListBuilder.InputRangeBuilder |
setTitleItem(@NonNull IconCompat icon, int imageMode)Sets the title item to be the provided icon. |
@NonNull ListBuilder.InputRangeBuilder |
setTitleItem(@NonNull IconCompat icon, int imageMode, boolean isLoading)Sets the title item to be the provided icon. |
@NonNull ListBuilder.InputRangeBuilder |
setValue(int value)Set the current value of the range. |
Public constructors
InputRangeBuilder
public InputRangeBuilder()
Builder to construct a input range row.
An input range row supports displaying a horizontal slider allowing slider input.
| See also | |
|---|---|
addInputRange |
Public methods
addEndItem
public @NonNull ListBuilder.InputRangeBuilder addEndItem(@NonNull 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.
addEndItem
public @NonNull ListBuilder.InputRangeBuilder addEndItem(@NonNull 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 | |
|---|---|
boolean isLoading |
indicates whether the app is doing work to load the added content in the background or not. |
setContentDescription
public @NonNull ListBuilder.InputRangeBuilder setContentDescription(@NonNull CharSequence description)
Sets the content description.
setInputAction
public @NonNull ListBuilder.InputRangeBuilder setInputAction(@NonNull PendingIntent action)
Set the PendingIntent to send when the current value is updated.
setInputAction
public @NonNull ListBuilder.InputRangeBuilder setInputAction(@NonNull RemoteCallback callback)
Set the PendingIntent to send when the current value is updated.
setLayoutDirection
public @NonNull ListBuilder.InputRangeBuilder setLayoutDirection(int layoutDirection)
Sets the desired layout direction for the content in this row.
| Parameters | |
|---|---|
int layoutDirection |
the layout direction to set. |
setMax
public @NonNull ListBuilder.InputRangeBuilder setMax(int max)
Set the upper limit of the range. The default is 100.
setMin
public @NonNull ListBuilder.InputRangeBuilder setMin(int min)
Set the lower limit of the range. The default is 0.
setPrimaryAction
public @NonNull ListBuilder.InputRangeBuilder setPrimaryAction(@NonNull 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 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 MODE_SHORTCUT representation of the slice.
setSubtitle
public @NonNull ListBuilder.InputRangeBuilder setSubtitle(@NonNull CharSequence title)
Set the subtitle.
setThumb
public @NonNull ListBuilder.InputRangeBuilder setThumb(@NonNull IconCompat thumb)
Set the Icon to be displayed as the thumb on the input range.
setTitle
public @NonNull ListBuilder.InputRangeBuilder setTitle(@NonNull CharSequence title)
Set the title.
setTitleItem
public @NonNull ListBuilder.InputRangeBuilder 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. |
| See also | |
|---|---|
ICON_IMAGE |
|
SMALL_IMAGE |
|
LARGE_IMAGE |
setTitleItem
public @NonNull ListBuilder.InputRangeBuilder 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. |
| See also | |
|---|---|
ICON_IMAGE |
|
SMALL_IMAGE |
|
LARGE_IMAGE |
setValue
public @NonNull ListBuilder.InputRangeBuilder setValue(int value)
Set the current value of the range.