# BannerStyle

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

*** ** * ** ***


```
@RequiresCarApi(value = 9)
@ExperimentalCarApi
@CarProtocol
public final class BannerStyle
```

<br />

*** ** * ** ***

Defines the visual style of a `https://developer.android.com/reference/androidx/car/app/model/Banner`.

This style can be used to customize the appearance of the visual container around a banner, such as its shape (corner radius) and background color.

Custom styles will fall back to host defaults if they are unset, or if they fail host-enforced contrast requirements.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 9) @https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi public final class https://developer.android.com/reference/androidx/car/app/model/BannerStyle.Builder` A builder for `https://developer.android.com/reference/androidx/car/app/model/BannerStyle`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/BannerStyle#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Background` | `https://developer.android.com/reference/androidx/car/app/model/BannerStyle#getBackground()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Background` of the container, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Shape` | `https://developer.android.com/reference/androidx/car/app/model/BannerStyle#getShape()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Shape` of the container, or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/BannerStyle#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/BannerStyle#toString()()` |

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getBackground

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

```
public @Nullable Background getBackground()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Background` of the container, or `null` if not set.

### getShape

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

```
public @Nullable Shape getShape()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Shape` of the container, or `null` if not set.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```