ListBuilder.RowBuilder

public static class ListBuilder.RowBuilder
extends Object

java.lang.Object
   ↳ androidx.slice.builders.ListBuilder.RowBuilder


Builder to construct a row. A row can be added as an item to ListBuilder via ListBuilder.addRow(RowBuilder).

A row supports:

  • Title item - The title item can be a timestamp, image, or a SliceAction. It appears with at the start of the row. There can only be one title item added to a row.
  • Title - Single line of text formatted as a title, see setTitle(CharSequence).
  • Subtitle - Single line of text below the title (if one exists) and is formatted as normal text, see setSubtitle(CharSequence).
  • End item - End items appear at the end of the row. There can be multiple end items that show depending on available width. End items can be a timestamp, image, or a tappable icon.
  • Primary action - The primary action for the row, this is the action that will be sent when the row is clicked. This is set via setPrimaryAction(SliceAction). If this is the only row or first row of the slice, then the action set here will be used to represent the slice shown in SliceView.MODE_SMALL.
There are a couple of restrictions to how content can be added to a row:
  • End items cannot contain a mixture of SliceActions and Icons.
  • There can only be one timestamp added to the row.

Summary

Public constructors

RowBuilder()

Builder to construct a row.

RowBuilder(Uri uri)

Builder to construct a normal row.

Public methods

ListBuilder.RowBuilder addEndItem(long timeStamp)

Adds a timestamp to the end items of the row builder.

ListBuilder.RowBuilder addEndItem(IconCompat icon, int imageMode)

Adds an icon to the end items of the row builder.

ListBuilder.RowBuilder addEndItem(SliceAction action, boolean isLoading)

Adds an action to the end items of the row builder.

ListBuilder.RowBuilder addEndItem(SliceAction action)

Adds an action to the end items of the row builder.

ListBuilder.RowBuilder addEndItem(IconCompat icon, int imageMode, boolean isLoading)

Adds an icon to the end items of the row builder.

ListBuilder.RowBuilder setContentDescription(CharSequence description)

Sets the content description for the row.

ListBuilder.RowBuilder setEndOfSection(boolean isEndOfSection)

Indicate that this row is an end for a section.

ListBuilder.RowBuilder setLayoutDirection(int layoutDirection)

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

ListBuilder.RowBuilder setPrimaryAction(SliceAction action)

The action specified here will be sent when the whole row is clicked.

ListBuilder.RowBuilder setSubtitle(CharSequence subtitle)

Sets the subtitle for the row builder.

ListBuilder.RowBuilder setSubtitle(CharSequence subtitle, boolean isLoading)

Sets the subtitle for the row builder.

ListBuilder.RowBuilder setTitle(CharSequence title)

Sets the title for the row builder.

ListBuilder.RowBuilder setTitle(CharSequence title, boolean isLoading)

Sets the title for the row builder.

ListBuilder.RowBuilder setTitleItem(SliceAction action)

Sets the title item to be a tappable icon.

ListBuilder.RowBuilder setTitleItem(long timeStamp)

Sets the title item to be the provided timestamp.

ListBuilder.RowBuilder setTitleItem(IconCompat icon, int imageMode, boolean isLoading)

Sets the title item to be the provided icon.

ListBuilder.RowBuilder setTitleItem(IconCompat icon, int imageMode)

Sets the title item to be the provided icon.

ListBuilder.RowBuilder setTitleItem(SliceAction action, boolean isLoading)

Sets the title item to be a tappable icon.

Inherited methods

Public constructors</