Banner


@ExperimentalCarApi
@CarProtocol
@RequiresCarApi(value = 9)
class Banner : Item


A banner element that's meant to be visually distinct from other normal elements on the screen.

For example, a banner can be used to tell the user whether the app is running in an online vs offline mode, or promote a specific event or announcement.

Summary

Nested types

A builder of Banner.

Constants

const Int

Represents a large edge-to-edge image to be displayed in the banner.

const Int

Represents a medium padded artwork image to be displayed in the banner.

const Int

Represents a small icon-sized image to be displayed in the banner.

Public functions

Boolean
equals(other: Any?)
(Mutable)List<Action!>

Returns the list of actions below the title and subtitle.

BannerElement?

Returns the leading element of the banner.

OnClickDelegate?

Returns the OnClickDelegate to be called back when the banner is clicked.

BannerStyle?

Returns the BannerStyle of the banner, or null if not set.

CarText?

Returns the subtitle of the banner.

CarText?

Returns the title of the banner.

(Mutable)List<BannerElement!>

Returns the list of trailing elements of the banner.

Int
String

Constants

IMAGE_TYPE_LARGE

Added in 1.9.0-alpha02
const val IMAGE_TYPE_LARGE = 3: Int

Represents a large edge-to-edge image to be displayed in the banner. Scales the image to fill the container and potentially clip within the bounds if a shape is applied.

This image type cannot be used in combination with addBelowAction.

IMAGE_TYPE_MEDIUM

Added in 1.9.0-alpha02
const val IMAGE_TYPE_MEDIUM = 2: Int

Represents a medium padded artwork image to be displayed in the banner.

The host renders it with standard padding and scales the image to fit within the bounds.

IMAGE_TYPE_SMALL

Added in 1.9.0-alpha02
const val IMAGE_TYPE_SMALL = 1: Int

Represents a small icon-sized image to be displayed in the banner.

The host renders it with standard padding and scales the image to fit within the bounds.

Public functions

equals

fun equals(other: Any?): Boolean

getBelowActions

Added in 1.8.0
fun getBelowActions(): (Mutable)List<Action!>

Returns the list of actions below the title and subtitle.

See also
addBelowAction

getLeadingElement

Added in 1.9.0-alpha02
fun getLeadingElement(): BannerElement?

Returns the leading element of the banner.

This is currently restricted to icons and images only.

getOnClickDelegate

Added in 1.8.0
fun getOnClickDelegate(): OnClickDelegate?

Returns the OnClickDelegate to be called back when the banner is clicked.

getStyle

Added in 1.9.0-alpha02
fun getStyle(): BannerStyle?

Returns the BannerStyle of the banner, or null if not set.

See also
setStyle

getSubtitle

Added in 1.8.0
fun getSubtitle(): CarText?

Returns the subtitle of the banner.

The subtitle is automatically truncated if it's too long; however, shorter variants can be added via addVariant.

See also
setSubtitle

getTitle

Added in 1.8.0
fun getTitle(): CarText?

Returns the title of the banner.

The title is automatically truncated if it's too long; however, shorter variants can be added via addVariant.

See also
setTitle

getTrailingElements

Added in 1.9.0-alpha02
fun getTrailingElements(): (Mutable)List<BannerElement!>

Returns the list of trailing elements of the banner.

hashCode

fun hashCode(): Int

toString

fun toString(): String