Badge


@CarProtocol
@ExperimentalCarApi
public class Badge


Represents a badge that can be displayed as an overlay on top of an image.

A badge denotes some sort of call to action, notification, alert, etc. An example is badging of application icons in a launcher to add a number at the top right corner which denotes how many active notifications that application has.

Summary

Nested types

public final class Badge.Builder

A builder of Badge.

Public methods

boolean
@Nullable CarColor

Returns the dot background color.

@Nullable CarIcon

Returns the badge icon.

boolean

Returns whether the badge has a dot.

int
@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getBackgroundColor

Added in 1.4.0
public @Nullable CarColor getBackgroundColor()

Returns the dot background color.

getIcon

Added in 1.4.0
public @Nullable CarIcon getIcon()

Returns the badge icon.

See also
setIcon

hasDot

Added in 1.4.0
public boolean hasDot()

Returns whether the badge has a dot.

See also
setHasDot

hashCode

public int hashCode()

toString

public @NonNull String toString()