Android 12 Developer Preview is here! Try it out, and give us your feedback!

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
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 PendingIntent to send when the current value is updated.

open ListBuilder.InputRangeBuilder
setInputAction(@NonNull callback: RemoteCallback)

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

open ListBuilder.InputRangeBuilder
setLayoutDirection(layoutDirection: Int)

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

open ListBuilder.InputRangeBuilder
setMax(max: Int)

Set the upper limit of the range.

open ListBuilder.InputRangeBuilder
setMin(min: Int)

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 Icon to be displayed as the thumb on the input range.

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
setValue(value: Int)

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: