Badge.Builder
class Badge.Builder
A builder of Badge.
Summary
Public functions |
|
|---|---|
Badge |
build()Constructs the |
Badge.Builder |
This function is deprecated. use |
Badge.Builder |
setDotColor(color: CarColor)Sets the color of the dot to the given |
Badge.Builder |
Enables a circular dot that denotes some sort of alert, notification, etc. |
Badge.Builder |
Sets an icon to be displayed as a badge. |
Badge.Builder |
setIconBackgroundColor(color: CarColor)Sets the color of the icon background to the given |
Public functions
build
fun build(): Badge
Constructs the Badge defined by this builder.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if the badge doesn't have a dot or an icon. |
java.lang.IllegalStateException |
if the a dot color is set but the badge has no dot. |
java.lang.IllegalStateException |
if the a icon background color is set but the badge has no icon. |
setBackgroundColor
funsetBackgroundColor(backgroundColor: CarColor): Badge.Builder
Sets the color of the dot to the given backgroundColor.
setDotColor
fun setDotColor(color: CarColor): Badge.Builder
Sets the color of the dot to the given color.
setHasDot
fun setHasDot(hasDot: Boolean): Badge.Builder
Enables a circular dot that denotes some sort of alert, notification, etc.
setIcon
fun setIcon(icon: CarIcon): Badge.Builder
Sets an icon to be displayed as a badge.
An icon badge gives context about the associated element on which it is displayed. For example, a work profile icon badge is displayed with an app icon to indicate that it is a work app.
setIconBackgroundColor
fun setIconBackgroundColor(color: CarColor): Badge.Builder
Sets the color of the icon background to the given color.