Badge.Builder


class Badge.Builder


A builder of Badge.

Summary

Public constructors

Returns an empty Builder instance.

Public functions

Badge

Constructs the Badge defined by this builder.

Badge.Builder
setBackgroundColor(backgroundColor: CarColor)

Sets the color of the dot to the given backgroundColor.

Badge.Builder
setHasDot(hasDot: Boolean)

Enables a circular dot that denotes some sort of alert, notification, etc.

Badge.Builder

Sets an icon to be displayed as a badge.

Public constructors

Builder

Added in 1.4.0
Builder()

Returns an empty Builder instance.

Public functions

build

Added in 1.4.0
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.

setBackgroundColor

Added in 1.4.0
fun setBackgroundColor(backgroundColor: CarColor): Badge.Builder

Sets the color of the dot to the given backgroundColor.

setHasDot

Added in 1.4.0
fun setHasDot(hasDot: Boolean): Badge.Builder

Enables a circular dot that denotes some sort of alert, notification, etc.

setIcon

Added in 1.4.0
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.