Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

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

Builder to construct a input range row.

Public methods
open ListBuilder.InputRangeBuilder
setValue(value: Int)

Set the current value of the range.

open ListBuilder.InputRangeBuilder
setThumb(@NonNull thumb: IconCompat)

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

open ListBuilder.InputRangeBuilder
setLayoutDirection(layoutDirection: Int)

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

open ListBuilder.InputRangeBuilder
setPrimaryAction(@NonNull action: SliceAction)

Set the primary action for this row.

open ListBuilder.InputRangeBuilder
setMax(max: Int)

Set the upper limit of the range.

open ListBuilder.InputRangeBuilder
setTitle(@NonNull title: CharSequence)

Set the title.

open ListBuilder.InputRangeBuilder
setSubtitle(@NonNull title: CharSequence)

Set the subtitle.

open ListBuilder.InputRangeBuilder
setInputAction(@NonNull action: PendingIntent)

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

open ListBuilder.InputRangeBuilder
setContentDescription(@NonNull description: CharSequence)

Sets the content description.

open ListBuilder.InputRangeBuilder
setMin(min: Int)

Set the lower limit 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

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).

setThumb

@NonNull open fun setThumb(@NonNull thumb: IconCompat): ListBuilder.InputRangeBuilder

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

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.

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.

setMax

@NonNull open fun setMax(max: Int): ListBuilder.InputRangeBuilder

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

setTitle

@NonNull open fun setTitle(@NonNull title: CharSequence): ListBuilder.InputRangeBuilder

Set the title.

setSubtitle

@NonNull open fun setSubtitle(@NonNull title: CharSequence): ListBuilder.InputRangeBuilder

Set the subtitle.

setInputAction

@NonNull open fun setInputAction(@NonNull action: PendingIntent): ListBuilder.InputRangeBuilder

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

setContentDescription

@NonNull open fun setContentDescription(@NonNull description: CharSequence): ListBuilder.InputRangeBuilder

Sets the content description.

setMin

@NonNull open fun setMin(min: Int): ListBuilder.InputRangeBuilder

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