BannerElement
@ExperimentalCarApi
@CarProtocol
@RequiresCarApi(value = 9)
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 |
|
|---|---|
const Int |
TYPE_ACTION = 1Type indicating the element is an |
const Int |
TYPE_IMAGE = 2Type indicating the element is an image/icon. |
Public functions |
|
|---|---|
Boolean |
|
Action? |
Returns the |
CarIcon? |
getImage()Returns the |
Int |
Returns the image type of the element. |
Int |
getType()Returns the type of the element. |
Int |
hashCode() |
String |
toString() |
Constants
TYPE_ACTION
const val TYPE_ACTION = 1: Int
Type indicating the element is an Action.
TYPE_IMAGE
const val TYPE_IMAGE = 2: Int
Type indicating the element is an image/icon.
Public functions
getAction
fun getAction(): Action?
Returns the Action in this element, or null if not set.
Actions with no getOnClickDelegate should be treated like icons.
getImage
fun getImage(): CarIcon?
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.