BannerElement


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


An internal wrapper class for elements (actions, icons, images) that can be displayed as leading or trailing items in a Banner.

Summary

Constants

static final int

Type indicating the element is an Action.

static final int

Type indicating the element is an image/icon.

Public methods

boolean
@Nullable Action

Returns the Action in this element, or null if not set.

@Nullable CarIcon

Returns the CarIcon in this element, or null if not set.

int

Returns the image type of the element.

int

Returns the type of the element.

int
@NonNull String

Constants

TYPE_ACTION

Added in 1.9.0-alpha02
public static final int TYPE_ACTION = 1

Type indicating the element is an Action.

TYPE_IMAGE

Added in 1.9.0-alpha02
public static final int TYPE_IMAGE = 2

Type indicating the element is an image/icon.

Public methods

equals

public boolean equals(@Nullable Object other)

getAction

Added in 1.9.0-alpha02
public @Nullable Action getAction()

Returns the Action in this element, or null if not set.

Actions with no getOnClickDelegate should be treated like icons.

getImage

Added in 1.9.0-alpha02
public @Nullable CarIcon getImage()

Returns the CarIcon in this element, or null if not set.

The host should check getType and getImageType to determine whether this should be rendered as an icon or an image.

getImageType

Added in 1.9.0-alpha02
public int getImageType()

Returns the image type of the element.

getType

Added in 1.9.0-alpha02
public int getType()

Returns the type of the element.

hashCode

public int hashCode()

toString

public @NonNull String toString()