public final class

RowSection.Builder

extends Section.BaseBuilder<Row, RowSection.Builder>

 java.lang.Object

androidx.car.app.model.Section.BaseBuilder<Row, RowSection.Builder>

↳androidx.car.app.model.RowSection.Builder

Overview

A builder that constructs RowSection instances.

Upon building, this class validates the following:

Summary

Constructors
publicBuilder()

Create a new RowSection builder.

publicBuilder(RowSection rowSection)

Create a new RowSection builder, copying values from an existing instance.

Methods
public RowSectionbuild()

Constructs a new RowSection from the current state of this builder, throwing exceptions for any invalid state.

public RowSection.BuilderclearSelectionGroup()

Unsets this RowSection from being shown as a selection group.

public RowSection.BuildersetAsSelectionGroup(int initialSelectedIndex)

Sets this entire RowSection as a selection group when passed a non-negative integer correlating to a valid index within the list of items added.

from Section.BaseBuilder<T, B>addItem, clearItems, setItems, setNoItemsMessage, setNoItemsMessage, setTitle, setTitle
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Create a new RowSection builder.

public Builder(RowSection rowSection)

Create a new RowSection builder, copying values from an existing instance.

Methods

public RowSection.Builder setAsSelectionGroup(int initialSelectedIndex)

Sets this entire RowSection as a selection group when passed a non-negative integer correlating to a valid index within the list of items added. The UI behaves equivalently to a radio button group where a single item is called out (either by an actual radio button, or through some other highlighting). The host will initially highlight the initialSelectedIndex's item and automatically update the highlight to other items if selected by the user. The app should handle user selections via Row.Builder.setOnClickListener(OnClickListener).

This cannot be used in conjunction with Row.Builder.setToggle(Toggle).

Parameters:

initialSelectedIndex: the index of the item to be selected when the template is first rendered

public RowSection.Builder clearSelectionGroup()

Unsets this RowSection from being shown as a selection group. See RowSection.Builder.setAsSelectionGroup(int).

public RowSection build()

Constructs a new RowSection from the current state of this builder, throwing exceptions for any invalid state.

See also: for the list of validation logic