InputRangeBuilder
open class InputRangeBuilder
kotlin.Any | |
↳ | 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 | |
---|---|
<init>() Builder to construct a input range row. |
Public methods | |
---|---|
open ListBuilder.InputRangeBuilder |
addEndItem(@NonNull action: SliceAction) Adds an action to the end items of the input range builder. |
open ListBuilder.InputRangeBuilder |
addEndItem(@NonNull action: SliceAction, isLoading: Boolean) Adds an action to the end items of the input range builder. |
open ListBuilder.InputRangeBuilder |
setContentDescription(@NonNull description: CharSequence) Sets the content description. |
open ListBuilder.InputRangeBuilder |
setInputAction(@NonNull action: PendingIntent) Set the |
open ListBuilder.InputRangeBuilder |
setInputAction(@NonNull callback: RemoteCallback) Set the |
open ListBuilder.InputRangeBuilder |
setLayoutDirection(layoutDirection: Int) Sets the desired layout direction for the content in this row. |
open ListBuilder.InputRangeBuilder |
Set the upper limit of the range. |
open ListBuilder.InputRangeBuilder |
Set the lower limit of the range. |
open ListBuilder.InputRangeBuilder |
setPrimaryAction(@NonNull action: SliceAction) Set the primary action for this row. |
open ListBuilder.InputRangeBuilder |
setSubtitle(@NonNull title: CharSequence) Set the subtitle. |
open ListBuilder.InputRangeBuilder |
setThumb(@NonNull thumb: IconCompat) Set the |
open ListBuilder.InputRangeBuilder |
setTitle(@NonNull title: CharSequence) Set the title. |
open ListBuilder.InputRangeBuilder |
setTitleItem(@NonNull icon: IconCompat, imageMode: Int) Sets the title item to be the provided icon. |
open ListBuilder.InputRangeBuilder |
setTitleItem(@NonNull icon: IconCompat, imageMode: Int, isLoading: Boolean) Sets the title item to be the provided icon. |
open ListBuilder.InputRangeBuilder |
Set the current value of the range. |
Public constructors
<init>
InputRangeBuilder()
Builder to construct a input range row.
An input range row supports displaying a horizontal slider allowing slider input.
Public methods
addEndItem
@NonNull open fun addEndItem(@NonNull action: SliceAction): ListBuilder.InputRangeBuilder
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
@NonNull open fun addEndItem(
@NonNull action: SliceAction,
isLoading: Boolean
): ListBuilder.InputRangeBuilder
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 | |
---|---|
isLoading |
Boolean: indicates whether the app is doing work to load the added content in the background or not. |
setContentDescription
@NonNull open fun setContentDescription(@NonNull description: CharSequence): ListBuilder.InputRangeBuilder
Sets the content description.
setInputAction
@NonNull open fun setInputAction(@NonNull action: PendingIntent): ListBuilder.InputRangeBuilder
Set the PendingIntent
to send when the current value is updated.
setInputAction
@NonNull open fun setInputAction(@NonNull callback: RemoteCallback): ListBuilder.InputRangeBuilder
Set the PendingIntent
to send when the current value is updated.
setLayoutDirection
@NonNull open fun setLayoutDirection(layoutDirection: Int): ListBuilder.InputRangeBuilder
Sets the desired layout direction for the content in this row.
Parameters | |
---|---|
layoutDirection |
Int: the layout direction to set. |
setMax
@NonNull open fun setMax(max: Int): ListBuilder.InputRangeBuilder
Set the upper limit of the range. The default is 100.
setMin
@NonNull open fun setMin(min: Int): ListBuilder.InputRangeBuilder
Set the lower limit of the range. The default is 0.
setPrimaryAction
@NonNull open fun setPrimaryAction(@NonNull action: SliceAction): ListBuilder.InputRangeBuilder
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 androidx.slice.widget.SliceView#MODE_SHORTCUT
representation of the slice.
setSubtitle
@NonNull open fun setSubtitle(@NonNull title: CharSequence): ListBuilder.InputRangeBuilder
Set the subtitle.
setThumb
@NonNull open fun setThumb(@NonNull thumb: IconCompat): ListBuilder.InputRangeBuilder
Set the Icon
to be displayed as the thumb on the input range.
setTitle
@NonNull open fun setTitle(@NonNull title: CharSequence): ListBuilder.InputRangeBuilder
Set the title.
setTitleItem
@NonNull open fun setTitleItem(
@NonNull icon: IconCompat,
imageMode: Int
): ListBuilder.InputRangeBuilder
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. |
See Also
setTitleItem
@NonNull open fun setTitleItem(
@NonNull icon: IconCompat,
imageMode: Int,
isLoading: Boolean
): ListBuilder.InputRangeBuilder
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. |
See Also
setValue
@NonNull open fun setValue(value: Int): ListBuilder.InputRangeBuilder
Set the current value of the range.
Parameters | |
---|---|
value |
Int: the value of the range, between setMin(int) and setMax(int) . |