Banner


@ExperimentalCarApi
@CarProtocol
@RequiresCarApi(value = 9)
public final class Banner implements 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

public final class Banner.Builder

A builder of Banner.

Public methods

boolean
@Nullable Background

Returns the background of the banner.

@NonNull List<Action>

Returns the list of actions below the title and subtitle.

@Nullable OnClickDelegate

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

@Nullable CarText

Returns the subtitle of the banner.

@Nullable CarText

Returns the title of the banner.

int
@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getBackground

Added in 1.9.0-alpha01
public @Nullable Background getBackground()

Returns the background of the banner.

See also
setBackground

getBelowActions

Added in 1.8.0
public @NonNull List<ActiongetBelowActions()

Returns the list of actions below the title and subtitle.

See also
addBelowAction

getOnClickDelegate

Added in 1.8.0
public @Nullable OnClickDelegate getOnClickDelegate()

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

getSubtitle

Added in 1.8.0
public @Nullable CarText getSubtitle()

Returns the subtitle of the banner.

The title 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
public @Nullable CarText getTitle()

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

hashCode

public int hashCode()

toString

public @NonNull String toString()