TabStyle.Builder
@RequiresCarApi(value = 9)
@ExperimentalCarApi
class TabStyle.Builder
A builder for TabStyle.
Summary
Public constructors |
|---|
Builder()Returns an empty |
|
Creates a new |
Public functions |
|
|---|---|
TabStyle |
build()Constructs a |
TabStyle.Builder |
setSelectedBackgroundColor(selectedBackgroundColor: CarColor?)Sets the |
TabStyle.Builder |
Sets the |
TabStyle.Builder |
setTextColor(textColor: CarColor?)Sets the |
Public constructors
Builder
Builder(tabStyle: TabStyle)
Creates a new TabStyle.Builder, populated from the input TabStyle.
Public functions
build
fun build(): TabStyle
Constructs a TabStyle from the current state of this builder.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if shape, selected background color, and text color are all unset. |
setSelectedBackgroundColor
fun setSelectedBackgroundColor(selectedBackgroundColor: CarColor?): TabStyle.Builder
Sets the CarColor of the tab indicator background when selected, or null to clear the color.
If a selected background color is not set or is cleared, the background color will fall back to host defaults.
Custom background colors are applied only when the tab is active (selected). On an unselected tab, the background color is ignored by the host and defaults to transparent.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
setShape
fun setShape(shape: Shape?): TabStyle.Builder
Sets the Shape of the container, or null to clear the shape.
If a shape is not set or is cleared, the container shape will fall back to host defaults.
setTextColor
fun setTextColor(textColor: CarColor?): TabStyle.Builder
Sets the CarColor for text displayed within the tab container, or null to clear the color.
If a text color is not set or is cleared, the text color will fall back to host defaults.
To customize the color of the tab's icon, see setTint.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |