# SpotlightSection.Builder

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/SpotlightSection.java+class:androidx.car.app.model.SpotlightSection.Builder) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

*** ** * ** ***


```
class SpotlightSection.Builder : Section.BaseBuilder<CondensedItem!, SpotlightSection.Builder!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.car.app.model.Section.BaseBuilder](https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder)\<[CondensedItem](https://developer.android.com/reference/kotlin/androidx/car/app/model/CondensedItem)!, [SpotlightSection.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder)!\> ||
|   | ↳ | [androidx.car.app.model.SpotlightSection.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder) |

*** ** * ** ***

A builder of `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder#Builder(androidx.car.app.model.CarIcon)(image: https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon)` Creates a new `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection` builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder#build()()` Constructs a new `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection` from the current state of this builder. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9) @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection.Builder#setIncompleteLastColumnStrategy(int)(incompleteLastColumnStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the strategy for handling incomplete last column |

### Inherited functions

From [androidx.car.app.model.Section.BaseBuilder](https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder) `B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#addItem(T)(item: T)`

Adds an item to this section, appending to the existing list of items.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#clearItems()()`

Delete all items in this section.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setItems(java.util.List<T>)(items: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<T!>)`

Sets the items for this section, overwriting any other previously set items.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setNoItemsMessage(androidx.car.app.model.CarText)(noItemsMessage: https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText?)`

Sets or clears the optional message to display in this section when there are 0 items added to it.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setNoItemsMessage(java.lang.CharSequence)(noItemsMessage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets or clears the optional message to display in this section when there are 0 items added to it.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setOnItemVisibilityChangedListener(androidx.car.app.model.ItemList.OnItemVisibilityChangedListener)(
onItemVisibilityChangedListener: https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList.OnItemVisibilityChangedListener?
)`

Sets the `https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList.OnItemVisibilityChangedListener` to call when the visible items in this `https://developer.android.com/reference/kotlin/androidx/car/app/model/Section` changes.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9)
@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setSectionHeader(androidx.car.app.model.SectionHeader)(sectionHeader: https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionHeader?)`

Sets the `https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionHeader` for this section.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setTitle(androidx.car.app.model.CarText)(title: https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText?)`

Sets or clears the optional title that appears above the items in this section.
`B` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/car/app/model/Section.BaseBuilder#setTitle(java.lang.CharSequence)(title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)`

Sets or clears the optional title that appears above the items in this section.

## Public constructors

### Builder

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
Builder(image: CarIcon)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection` builder.

## Public functions

### build

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
fun build(): SpotlightSection
```

Constructs a new `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection` from the current state of this builder.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if there are no items. |

### setIncompleteLastColumnStrategy

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@CanIgnoreReturnValue
@RequiresCarApi(value = 9)
@ExperimentalCarApi
fun setIncompleteLastColumnStrategy(incompleteLastColumnStrategy: Int): SpotlightSection.Builder
```

Sets the strategy for handling incomplete last column

By default, `https://developer.android.com/reference/kotlin/androidx/car/app/model/SpotlightSection#INCOMPLETE_LAST_COLUMN_AS_IS()` is used.