Alert


@CarProtocol
@RequiresCarApi(value = 5)
public final class Alert


Represents an alert with an optional icon, subtitle and actions.

Summary

Nested types

public final class Alert.Builder

A builder of Alert.

Constants

static final int

By setting the alert duration to this value, the progress bar (timer) on the alert will not be shown.

Public methods

boolean
@NonNull List<Action>

Returns the List of Actions associated with the alert.

@Nullable AlertCallbackDelegate

Returns the AlertCallbackDelegate that should be used for this alert.

long

Returns the maximum duration in milli seconds for which the alert can be shown.

@Nullable CarIcon

Returns the CarIcon to display in the alert or null if the alert does not have an icon.

int

Returns the id of the alert.

@Nullable CarText

Returns the subtitle displayed in the alert or null if the alert does not have a subtitle.

@NonNull CarText

Returns the title displayed in the alert.

int
@NonNull String

Constants

SHOW_ALERT_INDEFINITELY_DURATION

Added in 1.7.0-alpha02
public static final int SHOW_ALERT_INDEFINITELY_DURATION = 2147483647

By setting the alert duration to this value, the progress bar (timer) on the alert will not be shown.

Public methods

equals

public boolean equals(@Nullable Object other)

getActions

Added in 1.2.0
public @NonNull List<ActiongetActions()

Returns the List of Actions associated with the alert.

See also
addAction

getCallbackDelegate

Added in 1.2.0
public @Nullable AlertCallbackDelegate getCallbackDelegate()

Returns the AlertCallbackDelegate that should be used for this alert.

See also
Alert.Builder

getDurationMillis

Added in 1.2.0
public long getDurationMillis()

Returns the maximum duration in milli seconds for which the alert can be shown.

getIcon

Added in 1.2.0
public @Nullable CarIcon getIcon()

Returns the CarIcon to display in the alert or null if the alert does not have an icon.

See also
setIcon

getId

Added in 1.2.0
public int getId()

Returns the id of the alert.

getSubtitle

Added in 1.2.0
public @Nullable CarText getSubtitle()

Returns the subtitle displayed in the alert or null if the alert does not have a subtitle.

See also
setSubtitle

getTitle

Added in 1.2.0
public @NonNull CarText getTitle()

Returns the title displayed in the alert.

hashCode

public int hashCode()

toString

public @NonNull String toString()