ListBuilder.InputRangeBuilder

public 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 methods

@NonNull ListBuilder.InputRangeBuilder

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

Sets the content description.

@NonNull ListBuilder.InputRangeBuilder

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

@NonNull ListBuilder.InputRangeBuilder

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

@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

Set the primary action for this row.

@NonNull ListBuilder.InputRangeBuilder

Set the subtitle.

@NonNull ListBuilder.InputRangeBuilder

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

@NonNull ListBuilder.InputRangeBuilder

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

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

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

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

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setContentDescription(@NonNull CharSequence description)

Sets the content description.

setInputAction

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setInputAction(@NonNull PendingIntent action)

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

setInputAction

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setInputAction(@NonNull RemoteCallback callback)

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

setLayoutDirection

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

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setMax(int max)

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

setMin

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setMin(int min)

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

setPrimaryAction

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

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setSubtitle(@NonNull CharSequence title)

Set the subtitle.

setThumb

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setThumb(@NonNull IconCompat thumb)

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

setTitle

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setTitle(@NonNull CharSequence title)

Set the title.

setTitleItem

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

setTitleItem

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

setValue

Added in 1.1.0-alpha02
public @NonNull ListBuilder.InputRangeBuilder setValue(int value)

Set the current value of the range.

Parameters
int value

the value of the range, between setMin and setMax.