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 which denotes how many active notifications that application has.

Badges may have a dot which is a colored circle appearing in a different location to the icon.

Summary

Nested types

public final class Badge.Builder

A builder of Badge.

Public methods

boolean
@Nullable CarColor

This method is deprecated.

use getDotColor instead.

@Nullable CarColor

Returns the dot color.

@Nullable CarIcon

Returns the badge icon.

@Nullable CarColor

Returns the icon background color.

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
Deprecated in 1.8.0-alpha01
public @Nullable CarColor getBackgroundColor()

Returns the dot background color.

getDotColor

Added in 1.8.0-alpha01
public @Nullable CarColor getDotColor()

Returns the dot color.

getIcon

Added in 1.4.0
public @Nullable CarIcon getIcon()

Returns the badge icon.

See also
setIcon

getIconBackgroundColor

Added in 1.8.0-alpha01
public @Nullable CarColor getIconBackgroundColor()

Returns the icon background color.

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()