# CarProgressBarStyle.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/CarProgressBarStyle.java+class:androidx.car.app.model.CarProgressBarStyle.Builder) Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

*** ** * ** ***


```
public final class CarProgressBarStyle.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#Builder()()` Returns an empty `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder` instance. |
| `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#Builder(androidx.car.app.model.CarProgressBarStyle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle style)` Creates a new `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder`, populated from the input `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle` | `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#build()()` Constructs the `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle` defined by this builder. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder` | `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#setColor(androidx.car.app.model.CarColor)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor color)` Sets the color of the actual progress bar. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder` | `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#setStrokeCap(int)(int strokeCap)` Sets the stroke cap of the progress bar. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder` | `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder#setTrackColor(androidx.car.app.model.CarColor)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor color)` Sets the color of the track over which the progress bar is drawn. |

## Public constructors

### Builder

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

```
public Builder()
```

Returns an empty `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder` instance.

### Builder

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

```
public Builder(@NonNull CarProgressBarStyle style)
```

Creates a new `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle.Builder`, populated from the input `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle`.

## Public methods

### build

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

```
public @NonNull CarProgressBarStyle build()
```

Constructs the `https://developer.android.com/reference/androidx/car/app/model/CarProgressBarStyle` defined by this builder.

### setColor

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

```
public @NonNull CarProgressBarStyle.Builder setColor(@Nullable CarColor color)
```

Sets the color of the actual progress bar. That is, the part of the component that reflects progress and which fully encompasses the component when progress is complete.

If a color is not set, or if the provided color does not pass a contrast check, the host will use a default color.

### setStrokeCap

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

```
public @NonNull CarProgressBarStyle.Builder setStrokeCap(int strokeCap)
```

Sets the stroke cap of the progress bar.

If unset, the host will use a default shape defined by the system.

### setTrackColor

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

```
public @NonNull CarProgressBarStyle.Builder setTrackColor(@Nullable CarColor color)
```

Sets the color of the track over which the progress bar is drawn.

If a color is not set, or if the provided color does not pass a contrast check, the host will use a default color.