public final class

Badge.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.Badge.Builder

Overview

A builder of Badge.

Summary

Constructors
publicBuilder()

Returns an empty Badge.Builder instance.

Methods
public Badgebuild()

Constructs the Badge defined by this builder.

public Badge.BuildersetBackgroundColor(CarColor backgroundColor)

Sets the color of the dot to the given backgroundColor.

public Badge.BuildersetHasDot(boolean hasDot)

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

public Badge.BuildersetIcon(CarIcon icon)

Sets an icon to be displayed as a badge.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Returns an empty Badge.Builder instance.

Methods

public Badge.Builder setHasDot(boolean hasDot)

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

public Badge.Builder setBackgroundColor(CarColor backgroundColor)

Sets the color of the dot to the given backgroundColor.

public Badge.Builder setIcon(CarIcon icon)

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.

public Badge build()

Constructs the Badge defined by this builder.