Tab.Builder
class Tab.Builder
A builder of Tab.
Summary
Public constructors |
|---|
Builder()Returns an empty |
Public functions |
|
|---|---|
Tab |
build()Constructs the |
Tab.Builder |
setContentId(contentId: String)Sets the content ID of the tab. |
Tab.Builder |
Sets the icon to display in the tab. |
Tab.Builder |
setTitle(title: CharSequence)Sets the title of the tab. |
Public constructors
Public functions
build
fun build(): Tab
Constructs the Tab defined by this builder.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if the tab's title, icon or content ID is not set. |
setContentId
fun setContentId(contentId: String): Tab.Builder
Sets the content ID of the tab.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
java.lang.IllegalArgumentException |
if |
setIcon
fun setIcon(icon: CarIcon): Tab.Builder
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.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setTitle
fun setTitle(title: CharSequence): Tab.Builder
Sets the title of the tab.
Only DistanceSpans and DurationSpans are supported in the input string.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
java.lang.IllegalArgumentException |
if |