SectionHeader.Builder


class SectionHeader.Builder


A builder of SectionHeader.

Summary

Public constructors

Builder(title: CarText)

Returns a Builder instance configured with the given title.

Returns a Builder instance configured with the given title.

Public functions

SectionHeader

Builds the SectionHeader.

SectionHeader.Builder

Clears the subtitle of the header.

SectionHeader.Builder

Sets the end icon of the header.

SectionHeader.Builder

Sets the click listener for the header.

SectionHeader.Builder

Sets the start icon of the header with a default size of IMAGE_TYPE_SMALL.

SectionHeader.Builder
@CanIgnoreReturnValue
setStartIcon(startIcon: CarIcon, startIconType: Int)

Sets the start icon of the header and its size type.

SectionHeader.Builder

Sets the subtitle of the header.

SectionHeader.Builder

Sets the subtitle of the header.

Public constructors

Builder

Added in 1.8.0
Builder(title: CarText)

Returns a Builder instance configured with the given title.

The title must be a plain string with no spans other than those supported by TEXT_ONLY.

Throws
java.lang.NullPointerException

if title is null

java.lang.IllegalArgumentException

if title contains unsupported spans

Builder

Added in 1.8.0
Builder(title: CharSequence)

Returns a Builder instance configured with the given title.

The title must be a plain string with no spans other than those supported by TEXT_ONLY.

Throws
java.lang.NullPointerException

if title is null

java.lang.IllegalArgumentException

if title contains unsupported spans

See also
CarText

Public functions

build

Added in 1.8.0
fun build(): SectionHeader

Builds the SectionHeader.

Throws
java.lang.IllegalStateException

if a title has not been set

clearSubtitle

Added in 1.9.0-alpha01
@CanIgnoreReturnValue
fun clearSubtitle(): SectionHeader.Builder

Clears the subtitle of the header.

Returns
SectionHeader.Builder

this builder to help chaining

setEndIcon

Added in 1.8.0
@CanIgnoreReturnValue
fun setEndIcon(endIcon: CarIcon): SectionHeader.Builder

Sets the end icon of the header.

Only custom icon types (e.g. TYPE_CUSTOM) are supported.

Parameters
endIcon: CarIcon

the CarIcon to display after the title

Throws
java.lang.NullPointerException

if endIcon is null

java.lang.IllegalArgumentException

if endIcon is not a custom icon, or if it does not meet the DEFAULT constraints

setOnClickListener

Added in 1.8.0
@CanIgnoreReturnValue
fun setOnClickListener(onClickListener: OnClickListener): SectionHeader.Builder

Sets the click listener for the header.

If a listener is set, the header will become focusable and clickable.

Throws
java.lang.NullPointerException

if onClickListener is null

setStartIcon

Added in 1.9.0-alpha01
@CanIgnoreReturnValue
fun setStartIcon(startIcon: CarIcon): SectionHeader.Builder

Sets the start icon of the header with a default size of IMAGE_TYPE_SMALL.

Only custom icon types (e.g. TYPE_CUSTOM) are supported.

Parameters
startIcon: CarIcon

the CarIcon to display before the title

Throws
java.lang.NullPointerException

if startIcon is null

java.lang.IllegalArgumentException

if startIcon is not a custom icon, or if it does not meet the DEFAULT constraints

setStartIcon

Added in 1.8.0
@CanIgnoreReturnValue
fun setStartIcon(startIcon: CarIcon, startIconType: Int): SectionHeader.Builder

Sets the start icon of the header and its size type.

Only custom icon types (e.g. TYPE_CUSTOM) are supported.

Parameters
startIcon: CarIcon

the CarIcon to display before the title

startIconType: Int

the type of image to display. See SectionHeader for supported image types (e.g. IMAGE_TYPE_SMALL).

Throws
java.lang.NullPointerException

if startIcon is null

java.lang.IllegalArgumentException

if startIcon is not a custom icon, or if it does not meet the DEFAULT constraints

setSubtitle

Added in 1.9.0-alpha01
@CanIgnoreReturnValue
fun setSubtitle(subtitle: CarText): SectionHeader.Builder

Sets the subtitle of the header.

The subtitle must be a plain string with no spans other than those supported by TEXT_WITH_COLORS.

Parameters
subtitle: CarText

the subtitle to set

Throws
java.lang.NullPointerException

if subtitle is null

java.lang.IllegalArgumentException

if subtitle contains unsupported spans

See also
CarText

setSubtitle

Added in 1.9.0-alpha01
@CanIgnoreReturnValue
fun setSubtitle(subtitle: CharSequence): SectionHeader.Builder

Sets the subtitle of the header.

The subtitle must be a plain string with no spans other than those supported by TEXT_WITH_COLORS.

Parameters
subtitle: CharSequence

the subtitle to set

Throws
java.lang.NullPointerException

if subtitle is null

java.lang.IllegalArgumentException

if subtitle contains unsupported spans

See also
CarText