public final class

Tab.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.Tab.Builder

Overview

A builder of Tab.

Summary

Constructors
publicBuilder()

Returns an empty Tab.Builder instance.

publicBuilder(Tab tab)

Creates a new Tab.Builder, populated from the input Tab

Methods
public Tabbuild()

Constructs the Tab defined by this builder.

public Tab.BuildersetContentId(java.lang.String contentId)

Sets the content ID of the tab.

public Tab.BuildersetIcon(CarIcon icon)

Sets the icon to display in the tab.

public Tab.BuildersetTitle(java.lang.CharSequence title)

Sets the title of the tab.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Returns an empty Tab.Builder instance.

public Builder(Tab tab)

Creates a new Tab.Builder, populated from the input Tab

Methods

public Tab.Builder setTitle(java.lang.CharSequence title)

Sets the title of the tab.

Only DistanceSpans and DurationSpans are supported in the input string.

public Tab.Builder setContentId(java.lang.String contentId)

Sets the content ID of the tab.

public Tab.Builder setIcon(CarIcon icon)

Sets the icon to display in the tab.

Icon Sizing Guidance

To minimize scaling artifacts across a wide range of car screens, apps should provide icons targeting a 36 x 36 dp bounding box. If the icon exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving its aspect ratio.

See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.

public Tab build()

Constructs the Tab defined by this builder.