ListBuilder.InputRangeBuilder

class ListBuilder.InputRangeBuilder

Known direct subclasses
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 functions

ListBuilder.InputRangeBuilder

Adds an action to the end items of the input range builder.

ListBuilder.InputRangeBuilder
addEndItem(action: SliceAction, isLoading: Boolean)

Adds an action to the end items of the input range builder.

ListBuilder.InputRangeBuilder

Sets the content description.

ListBuilder.InputRangeBuilder

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

ListBuilder.InputRangeBuilder

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

ListBuilder.InputRangeBuilder
setLayoutDirection(layoutDirection: Int)

Sets the desired layout direction for the content in this row.

ListBuilder.InputRangeBuilder
setMax(max: Int)

Set the upper limit of the range.

ListBuilder.InputRangeBuilder
setMin(min: Int)

Set the lower limit of the range.

ListBuilder.InputRangeBuilder

Set the primary action for this row.

ListBuilder.InputRangeBuilder

Set the subtitle.

ListBuilder.InputRangeBuilder

Set the Icon to be displayed as the thumb on the input range.

ListBuilder.InputRangeBuilder

Set the title.

ListBuilder.InputRangeBuilder
setTitleItem(icon: IconCompat, imageMode: Int)

Sets the title item to be the provided icon.

ListBuilder.InputRangeBuilder
setTitleItem(icon: IconCompat, imageMode: Int, isLoading: Boolean)

Sets the title item to be the provided icon.

ListBuilder.InputRangeBuilder
setValue(value: Int)

Set the current value of the range.

Public constructors

InputRangeBuilder

Added in 1.1.0-alpha02
InputRangeBuilder()

Builder to construct a input range row.

An input range row supports displaying a horizontal slider allowing slider input.

See also
addInputRange

Public functions

addEndItem

Added in 1.1.0-alpha02
fun addEndItem(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

Added in 1.1.0-alpha02
fun addEndItem(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

Added in 1.1.0-alpha02
fun setContentDescription(description: CharSequence): ListBuilder.InputRangeBuilder

Sets the content description.

setInputAction

Added in 1.1.0-alpha02
fun setInputAction(action: PendingIntent): ListBuilder.InputRangeBuilder

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

setInputAction

Added in 1.1.0-alpha02
fun setInputAction(callback: RemoteCallback): ListBuilder.InputRangeBuilder

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

setLayoutDirection

Added in 1.1.0-alpha02
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

Added in 1.1.0-alpha02
fun setMax(max: Int): ListBuilder.InputRangeBuilder

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

setMin

Added in 1.1.0-alpha02
fun setMin(min: Int): ListBuilder.InputRangeBuilder

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

setPrimaryAction

Added in 1.1.0-alpha02
fun setPrimaryAction(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 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

Added in 1.1.0-alpha02
fun setSubtitle(title: CharSequence): ListBuilder.InputRangeBuilder

Set the subtitle.

setThumb

Added in 1.1.0-alpha02
fun setThumb(thumb: IconCompat): ListBuilder.InputRangeBuilder

Set the Icon to be displayed as the thumb on the input range.

setTitle

Added in 1.1.0-alpha02
fun setTitle(title: CharSequence): ListBuilder.InputRangeBuilder

Set the title.

setTitleItem

Added in 1.1.0-alpha02
fun setTitleItem(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.

setTitleItem

Added in 1.1.0-alpha02
fun setTitleItem(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.

setValue

Added in 1.1.0-alpha02
fun setValue(value: Int): ListBuilder.InputRangeBuilder

Set the current value of the range.

Parameters
value: Int

the value of the range, between setMin and setMax.